Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Use the output file of first job as input of second Job
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: 686
Location: Earth

PostPosted: Tue May 08, 2007 4:38 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue May 08, 2007 5:17 pm    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Tue May 08, 2007 5:24 pm    Post subject: Re: Sorting files
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    Post subject: Thanks , more required....
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    Post subject:
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    Post subject: Re: Use the output file of first job as input of second Job
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us