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

how to copy records into multiple files depending on cond


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

Active User


Joined: 13 Jul 2007
Posts: 128
Location: Guntur

PostPosted: Mon Sep 10, 2007 6:55 pm
Reply with quote

Hi all,

I have a new requirement like i have a flat file with 9000 records , now what i have to do is , i have to create 90 ps files which should contain 100 records each.

i have one solution like keep on submitting the below job for 90 times and it will create the output files
Code:

STEP1    EXEC PGM=SYNCSORT                     
SYSOUT   DD SYSOUT=*                             
SORTIN   DD DSN=TEST.DM.PGMLIST.NONDUP,DISP=SHR   
SORTOUT  DD  DSN=TEST.DM.SSN.PGMLIST.OUT200,     
             DISP=(NEW,CATLG,DELETE),             
             UNIT=(SYSDA,8),SPACE=(CYL,(1,5),RLSE),
             DCB=(*.SORTIN)                       
SYSIN    DD *                                     
         SORT FIELDS=COPY,SKIPREC=100,STOPAFT=100


Can any body give me solution so that i can do it in one shot.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Mon Sep 10, 2007 7:10 pm
Reply with quote

Submitting 90 jobs is not a good option. You can try using the SPLIT1R of SYNCSORT. Please refer to the manual for details. Even here you will have to specify 90 output file names in the JCL.

You can code a REXX exec to dynamically create the JCL with all the 90 output file details and can split in one shot. Else, manually create the JCL and submit.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Sep 10, 2007 7:18 pm
Reply with quote

I do not see any limitation specified to in the FILES=xx parameter of the OUTREC......
Possibly adding a seq num in input and a large IFTHEN WHEN....Something like:
IFTHEN WHEN seq < 101 BUILD FILES=01
IFTHEN WHEN seq < 201 BUILD FILES=02
IFTHEN WHEN seq < 301 BUILD FILES=03
IFTHEN WHEN seq < 401 BUILD FILES=04
.
.
.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Sep 10, 2007 9:20 pm
Reply with quote

Quote:
You can try using the SPLIT1R of SYNCSORT.


SPLIT1R=n is a DFSORT parameter. It is NOT supported by Syncsort.
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 128
Location: Guntur

PostPosted: Tue Sep 11, 2007 11:08 am
Reply with quote

hi,

Can anybody give me the rexx code to do the same.
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 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top