IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Use the output file of first job as input of second Job


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bh

New User


Joined: 19 Mar 2006
Posts: 26
Location: India

PostPosted: Tue May 08, 2007 4:23 pm
Reply with quote

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
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Tue May 08, 2007 4:38 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue May 08, 2007 5:17 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue May 08, 2007 5:24 pm
Reply with quote

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
View user's profile Send private message
bh

New User


Joined: 19 Mar 2006
Posts: 26
Location: India

PostPosted: Tue May 08, 2007 5:30 pm
Reply with quote

Thank you all !!


Abhijit(agkshrisagar) , could you please provide me with code or syntax or some coded example.
Back to top
View user's profile Send private message
er_vinodh

New User


Joined: 08 Jul 2005
Posts: 3
Location: Chennai

PostPosted: Tue May 22, 2007 10:59 am
Reply with quote

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
View user's profile Send private message
bh

New User


Joined: 19 Mar 2006
Posts: 26
Location: India

PostPosted: Thu May 24, 2007 4:32 pm
Reply with quote

Thank u.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top