View previous topic :: View next topic
|
Author |
Message |
bh
New User
Joined: 19 Mar 2006 Posts: 26 Location: India
|
|
|
|
Hi,
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.
Regards,
bh |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
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. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Quote: |
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,
Creating program
DISP=(,CATLG,DELETE)
Sort - Sortin
DISP=(OLD,DELETE,KEEP)
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. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
bh wrote: |
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 |
As suggested, reformat via sort/copy
Quote: |
i have to use the output file of first job as input file in the second job. |
Oh, can't use copy, must use sort....Or, change the recl on the COBOL program.... |
|
Back to top |
|
|
bh
New User
Joined: 19 Mar 2006 Posts: 26 Location: India
|
|
|
|
Thank you all !!
Abhijit(agkshrisagar) , could you please provide me with code or syntax or some coded example. |
|
Back to top |
|
|
er_vinodh
New User
Joined: 08 Jul 2005 Posts: 3 Location: Chennai
|
|
|
|
hi here is the sample of the sort syntax:
//STEP010 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&T.&SP.LRECL15,DISP=SHR
//SORTOUT DD DSN=&T.&SP.LRECL25,
// DATACLAS=SMSALLOC,DISP=(,CATLG),
// RECFM=FB,LRECL=25
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,15,16:10X)
//*
here we r passing spaces into the remaining 10 bytes...
hope this helps :)
cheers
anitha. |
|
Back to top |
|
|
bh
New User
Joined: 19 Mar 2006 Posts: 26 Location: India
|
|
|
|
Thank u. |
|
Back to top |
|
|
|