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

Dynamic file allocation in JCL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Thu Mar 18, 2010 5:17 pm
Reply with quote

I have a sort step, in which the number of output files is to be determined by the number of records in a Vsam file.

I have developed a dynamic sort card
Code:
  SORT FIELDS=COPY                                             
  OUTFIL FNAMES=SORTOUT,REMOVECC,                             
  HEADER1=(3:'SORT FIELDS=COPY',80:X),                         
  OUTREC=(3:C'OUTFIL FILES=',SEQNUM,2,ZD,18:C',',80:X,/,       
   5:C'INCLUDE=(56,5,CH,EQ,C''',37,5,C'''),',80:X,/,           
   5:C'OUTREC=(1:1,55)',80:X)   


Output1 :
Code:
 SORT FIELDS=COPY                   
 OUTFIL FILES=01,                   
   INCLUDE=(56,5,CH,EQ,C'AAAAA'),   
   OUTREC=(1:1,55)                   
 OUTFIL FILES=02,                   
   INCLUDE=(56,5,CH,EQ,C' 2382'),   
   OUTREC=(1:1,55)   


I hvae another dynamic sort for the number of files
Code:
 SORT FIELDS=COPY                                           
 OUTFIL BUILD=(1:C'//SORTOF',SEQNUM,2,ZD,C'  DD DSN',       
   C'=T.TPS266DP.FILE',SEQNUM,2,ZD,C',',80:X,/,             
   C'//              DISP=(,CATLG,DELETE),',80:X,/,         
   C'//              UNIT=SYSDA,',80:X,/,                   
   C'//              SPACE=(80,(1000,500),RLSE),',80:X,/,   
   C'//              DCB=(RECFM=FB,LRECL=80),',80:X) 


Output file content
Code:
//SORTOF01  DD DSN=T.TPS266DP.FILE01,     
//              DISP=(,CATLG,DELETE),     
//              UNIT=SYSDA,               
//              SPACE=(80,(1000,500),RLSE),
//              DCB=(RECFM=FB,LRECL=80),   
//SORTOF02  DD DSN=T.TPS266DP.FILE02,     
//              DISP=(,CATLG,DELETE),     
//              UNIT=SYSDA,               
//              SPACE=(80,(1000,500),RLSE),
//              DCB=(RECFM=FB,LRECL=80),   




Now I need to give the content of output2 as the files in a job using the output1 as the sortcard.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Mar 18, 2010 5:43 pm
Reply with quote

OK. I guess I don't understand what the question is. You've got your input sort parameters for a SORT step and the details for the number of output datasets you'll need. They just need to be added or included to a job and then that job can be submitted.
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Thu Mar 18, 2010 6:18 pm
Reply with quote

superk wrote:
They just need to be added or included to a job and then that job can be submitted.


Yes i want to know how to combine them.
How could the content of a flat file(output2) be given as the output dataset for a Sort step ?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Mar 18, 2010 6:34 pm
Reply with quote

I don't know. I guess however your site handles these situations and what rules/standards you have to abide by.

You could use the INCLUDE statement. You could dynamically build and submit a job, either in its entirety or partially. Does your job scheduling system allow you to bring in external files to your application and then include them as part of the job stream?
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Fri Mar 19, 2010 2:43 pm
Reply with quote

superk

I tired with INCLUDE and it Worked!!!

Thanks icon_biggrin.gif
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
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
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top