I have a job which generates an output file and this output file should be used as input file in some other job.
The input file in the second job has an assign clause coded in a COBOl program which this job calls, this input file has ,say- 25 as the logical record length specified in the COBOL program but the output file generated from the previous job has 15 as the record length, so how can i solve this matter , i have to use the output file of first job as input file in the second job.
You can add a SORT step before your COBOL program step.
Give your input file to sort step to get a second file (With required RECLN) and give it to your COBOL program.
In case you don't want to use 2 files then, catch the o/p of first step ina temp file (&&DSN), use this temp file as input to SORT step, o/p of this should be a file of required length.
Joined: 14 Mar 2007 Posts: 8629 Location: Back in jolly old England
catch the o/p of first step ina temp file (&&DSN), use this temp file as input to SORT step, o/p of this should be a file of required length.
I think that I would tend to use the two permanent files, but that depends on the time taken to process the program which creates the 15 byte records. If it takes a few minutes, then OK, use a temp file, but for the sake of restart / savings,
Sort - Sortin
Which would delete the "extra" file on completion of the sort.
To be extra sure if you want to, because the DISP processing will be honoured in the case of a non zero return code, use DISP=OLD, and conditionally execute an IDCAMS after the sort has returned a zero.