Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to override LRECL for a dynamically allocated variable file in COB

Status
Not open for further replies.

Hullu

Programmer
Aug 15, 2008
2
0
0
I have been reading an old thread from 2004(thread209-691941)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 and thanks to all individuals involved in that thread.

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 (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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top