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
 

 

Create Multiple Files Based on Input File record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Puspojit

New User


Joined: 10 Mar 2008
Posts: 34
Location: Pune

PostPosted: Fri Oct 23, 2009 2:11 am    Post subject: Create Multiple Files Based on Input File record
Reply with quote

Hello All,
I have a File which contains Funds only. Each Fund is say 3 Byte and new funds are incepted/ Old Funds are deleted periodically.
Every Quarter, we read a Tax File and split the Tax File
in to n no. of files assuming n funds present in the Fund File.We do this using sort but have to manually identify the Funds present in fund file and add Parms in the job if new Fund are incepted .

Lets consider an example :
At start of the Quarter we have AAA,BBB and CCC in fund file.
So we split the TAX file to TAX.AAA, TAX.BBB and TAX.CCC . This split is a simple INCLUDE COND=(1,3,CH,EQ,AAA) on the Tax file. Similar process followed for other Funds. And then we process the splitted Tax Files.

The issue is we have to add/remove steps in our job every quarter as the Fund file changes periodically. Is it possible that we automate the process whereby the Fund File is read and based on the no. of funds present in it, the tax File is split into seperate files ?

Say,if for the next quarter fund DDD is added, then the new process should be smart enough to identify this fund and create a new file TAX.DDD without manual interpretation ? (Currently we have to add a step in the job to achieve this).
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Oct 23, 2009 2:55 am    Post subject: Reply to: Create Multiple Files Based on Input File record
Reply with quote

Puspojit,

Here is a DFSORT job which will give you the desired results. The number of files you want to split is dynamically generated. If the funds file is empy the job will not generate the dynamic JCL

Verify the output from step0200. It will have the actual Job required to split the input file. Once verified that JCL is created correctly change the following statement in step0200
Code:

//SORTOUT  DD SYSOUT=*


to the following
Code:

//SORTOUT  DD SYSOUT=(*,INTRDR)



The following JCL will create a dynamic JCL based on the policy numbers.

Code:

//STEP0100 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD *                                               
AAA                                                           
BBB                                                           
CCC                                                           
//DDOUT    DD DSN=&&DD,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)   
//CCOUT    DD DSN=&&CC,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)   
//SORTOUT  DD DUMMY                                           
//SYSIN    DD *                                               
  SORT FIELDS=COPY                                           
  OUTFIL NULLOFL=RC4                                         
                                                             
  OUTFIL FNAMES=DDOUT,REMOVECC,NODETAIL,BUILD=(80X),         
  SECTIONS=(1,3,                                             
  HEADER3=('//*',80:X),                                       
  TRAILER3=('//',1,3,6X,'DD DSN=TAX.',1,3,',',/,             
            '//',12X,'DISP=(NEW,CATLG,DELETE),',/,           
            '//',12X,'UNIT=SYSDA,',/,                         
            '//',12X,'SPACE=(CYL,(2,1),RLSE)',80:X))         
                                                             
  OUTFIL FNAMES=CCOUT,REMOVECC,NODETAIL,BUILD=(80X),         
  HEADER1=(1:'//SYSIN    DD *',/,                             
           3:'OPTION COPY'),                                 
  SECTIONS=(1,3,                                             
  TRAILER3=(3:'OUTFIL FNAMES=',1,3,                           
              ',INCLUDE=(1,3,CH,EQ,C''',1,3,'''',C')',80:X)),
  TRAILER1=('//*',80:X)                                       
//*                                                           
//STEP0200 EXEC  PGM=SORT,COND=(4,EQ,STEP0100)   
//SYSOUT   DD SYSOUT=*                           
//SYSIN    DD *                                 
   OPTION COPY                                   
/*                                               
//SORTOUT  DD SYSOUT=*                           
//SORTIN   DD DATA,DLM=$$                       
//SPLITJOB JOB 'SPLIT JOB',                     
//             CLASS=A,                         
//             MSGCLASS=Y,                       
//             MSGLEVEL=(1,1),                   
//             NOTIFY=T-ID                       
//*                                             
//STEP0100 EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                           
//SORTIN   DD DSN=YOUR.TAX.FILE.TO.BE.SPLIT,     
//            DISP=SHR                           
$$                                               
//         DD DSN=&DD,DISP=(OLD,PASS)           
//         DD DSN=&CC,DISP=(OLD,PASS)           
//*


The output generated from the above jcl is

Code:

//SPLITJOB JOB 'SPLIT JOB',                           
//             CLASS=A,                               
//             MSGCLASS=Y,                           
//             MSGLEVEL=(1,1),                       
//             NOTIFY=T-ID                           
//*                                                   
//STEP0100 EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD DSN=YOUR.TAX.FILE.TO.BE.SPLIT,         
//            DISP=SHR                               
//*                                                   
//AAA      DD DSN=TAX.AAA,                           
//            DISP=(NEW,CATLG,DELETE),               
//            UNIT=SYSDA,                             
//            SPACE=(CYL,(2,1),RLSE)                 
//*                                                   
//BBB      DD DSN=TAX.BBB,                           
//            DISP=(NEW,CATLG,DELETE),               
//            UNIT=SYSDA,                             
//            SPACE=(CYL,(2,1),RLSE)                 
//*                                                   
//CCC      DD DSN=TAX.CCC,                           
//            DISP=(NEW,CATLG,DELETE),               
//            UNIT=SYSDA,                             
//            SPACE=(CYL,(2,1),RLSE)                 
//SYSIN    DD *                                       
  OPTION COPY                                         
  OUTFIL FNAMES=AAA,INCLUDE=(1,3,CH,EQ,C'AAA')       
  OUTFIL FNAMES=BBB,INCLUDE=(1,3,CH,EQ,C'BBB')       
  OUTFIL FNAMES=CCC,INCLUDE=(1,3,CH,EQ,C'CCC')       
//*                                                   
Back to top
View user's profile Send private message
Puspojit

New User


Joined: 10 Mar 2008
Posts: 34
Location: Pune

PostPosted: Fri Oct 23, 2009 9:27 pm    Post subject:
Reply with quote

Kolusu,
Thank you so much for the solution..... It works perfectly as required.
The JCL was exactly what I was looking for.
Thanks Once Again,
Puspojit
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am


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