Does anybody know whether it is possible to overrride LRECL for a variable input file, dynamically allocated in COBOL via “setenv” or not?

5 pts.
Tags:
COBOL
LRECL
Does anybody know whether it is possible to overrride LRECL for a variable input file, dynamically allocated in COBOL via "setenv" or not? Here is why: I have been reading an old thread in Tek Tips from 2004(thread209-691941: How to Input Variable Length Record File)which illustrated how to override LRECL of a variable input file in JCL so that it matched the COBOL FD record size, and thus avoided IGZ0201W error. It works great. However I have not been able to override LRECL when allocating the same variable file dynamically. I get IGZ0201W, which indicates the override was ignored (as attached). As you may know, dynamic file allocation is relatively new in z/OS COBOL. It is done via call "setenv". It is mentioned in COBOL Programming Guide, and explained with some examples in an IBM presentation by Tom Ross (which shows up when you search for COBOL and setenv from most search engines). Does anybody know whether it is possible to overrride LRECL for a variable file, dynamically allocated in COBOL via "setenv" or not? I am enclosing further details. Thanks in advance Hullu FD DYN-VAR-FILE RECORDING MODE V BLOCK CONTAINS 0 RECORD IS VARYING IN SIZE DEPENDING ON WS-VAR-REC-SIZE. 01 REMOTE-RECORD-V. 05 FILLER OCCURS 1 TO 80 DEPENDING ON WS-VAR-REC-SIZE PIC X. 01 WS-VAR-REC-SIZE PIC 9(4) COMP-5. MOVE z'DYNFILE' to ENV-NAME MOVE 1 TO ENV-OVERWRITE MOVE SPACES TO ENV-VALUE STRING 'DSN(' INPUT-FILE DELIMITED BY SPACE ') SHR REUSE LRECL(84)' DELIMITED BY SIZE INTO ENV-VALUE display 'env-value' env-value CALL "setenv" USING ENV-NAME, ENV-VALUE, ENV-OVERWRITE OPEN INPUT DYN-VAR-FILE gets error: env-valueDSN(GIRHU01.P095.RMT.RL200) SHR REUSE LRECL(84) IGZ0201W A file attribute mismatch was detected. File DYN-VAR-FILE in program PPPP had a record length of 84 and the file specified in the ASSIGN clause had a record length of 200. Input file's allocation is RECFM=VB, RECLEN=200. This program needs to process variable files with different record length. Only the first 80 characters are used by this program. This is why I need to override to 84 (80 plus 4). As I mentioned before, the same file works in a version of the same prigram which does not use dynamic allocation, when I override LRECL via JCL as follows: //DYNFILE DD DSN=inputfile,DISP=SHR,DCB=(LRECL=84) It is the dynamic allocation which does not seem to accept the LRECL override. I also tried with commas in ENV-VALUE, eg. STRING 'DSN(' INPUT-FILE DELIMITED BY SPACE ') SHR,REUSE,LRECL(84)' DELIMITED BY SIZE INTO ENV-VALUE It has the same error also.

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following