JCL Split IF more than 200 Steps



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

JCL Split IF more than 200 Steps

Postby Ramsee » Mon Mar 10, 2014 1:45 pm

Hi All,

Warm greeting!!

I have a requirement that need to split a JCL File that contains more than 500 steps in it, I need to split JCL file for every 200 steps and write into an another file.

sample jcl:
details:
1.STEP Numbers are sequential and every step ends with a delimiter "/*"
2.INPUT JCL FILE FORMAT = FB , RECORD LENGTH = 80
//PS0001   EXEC PGM=PKZIP,             
//SYSPRINT DD SYSOUT=U                   
//SYSOUT   DD SYSOUT=U                   
//SYSUDUMP DD SYSOUT=V                   
//INPUT      DD DSN=USER.V0002,DISP=SHR
//OUTPUT   DD DSN=USER.V0002066.ZIP,
//            DISP=(,CATLG,DELETE),       
//            SPACE=(CYL,(1,1),RLSE),     
//            DCB=(RECFM=U,BLKSIZE=27998)
//SYSIN    DD *                           
-ECHO                                     
-INDD(INPUT)                             
-ARCHOUTDD(OUTPUT)                       
-TEXT                                     
-PASSWORD(TEST)                       
-NIA(USER.V0002,V0002066.TXT)     
/*                                       
.
.
.
.
.
.
//PS0517   EXEC PGM=PKZIP,             
//SYSPRINT DD SYSOUT=U                   
//SYSOUT   DD SYSOUT=U                   
//SYSUDUMP DD SYSOUT=V                   
//INPUT    DD DSN=USER.V1999,DISP=SHR   
//OUTPUT   DD DSN=USER.V1999066.ZIP,     
//            DISP=(,CATLG,DELETE),     
//            SPACE=(CYL,(1,1),RLSE),   
//            DCB=(RECFM=U,BLKSIZE=27998)
//SYSIN    DD *                         
-ECHO                                   
-INDD(INPUT)                             
-ARCHOUTDD(OUTPUT)                       
-TEXT                                   
-PASSWORD(TEST)                       
-NIA(USER.V1999,V1999066.TXT)           
/*                                       

Kindly suggest me how to split this FILE for every 200 steps and write into a new file.

Regards,
Ramsee
Ramsee
 
Posts: 25
Joined: Wed Nov 20, 2013 6:08 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL Split IF more than 200 Steps

 

Re: JCL Split IF more than 200 Steps

Postby enrico-sorichetti » Mon Mar 10, 2014 2:11 pm

the jcl is (1) handwritten once for all or is (2)generated automatically

in both cases the fastest way is to change the process that generates the jcl
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: JCL Split IF more than 200 Steps

Postby Ramsee » Mon Mar 10, 2014 2:19 pm

Its an automatically generated steps by a COBOL pgm
Ramsee
 
Posts: 25
Joined: Wed Nov 20, 2013 6:08 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL Split IF more than 200 Steps

Postby enrico-sorichetti » Mon Mar 10, 2014 2:25 pm

then there is no reason not to change the cobol program to do the split itself

exec pgm=<the program>,parm=

where if parm omitted or set to 0 a single file is generated ( no split )
otherwise split every PARM provided steps

and please ...
do not complain about having to allocate the MAX number of files that could result for the split...
You will have to do that even if You were able to use sort

a simpler way from a file allocation point of view could be to store the segments as members of a PDS
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: JCL Split IF more than 200 Steps

Postby skolusu » Tue Mar 11, 2014 2:42 am

As Enrico mentioned you should be splitting the file in the cobol program itself. But if you do insist doing it separately then use the following JCL

//STEP0100 EXEC PGM=SORT 
//SYSOUT   DD SYSOUT=*   
//SORTIN   DD DISP=SHR,DSN=Your Input file to split
//OUT01    DD SYSOUT=*                                       
//OUT02    DD SYSOUT=*                                       
//OUT03    DD SYSOUT=*                                       
//OUT04    DD SYSOUT=*                                       
//OUT05    DD SYSOUT=*                                       
//SYSIN    DD *                                             
  OPTION COPY                                               
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(12,9,CH,EQ,C'EXEC PGM='), 
  PUSH=(81:ID=4))                                           
                                                             
  OUTFIL FNAMES=OUT01,BUILD=(1,80),                         
  INCLUDE=(81,4,ZD,GT,0000,AND,81,4,ZD,LE,0200)             
                                                             
  OUTFIL FNAMES=OUT02,BUILD=(1,80),                         
  INCLUDE=(81,4,ZD,GT,0200,AND,81,4,ZD,LE,0400)             
                                                             
  OUTFIL FNAMES=OUT03,BUILD=(1,80),                         
  INCLUDE=(81,4,ZD,GT,0400,AND,81,4,ZD,LE,0600)             
                                                             
  OUTFIL FNAMES=OUT04,BUILD=(1,80),                         
  INCLUDE=(81,4,ZD,GT,0600,AND,81,4,ZD,LE,0800)             
                                                             
  OUTFIL FNAMES=OUT05,BUILD=(1,80),                         
  INCLUDE=(81,4,ZD,GT,0800,AND,81,4,ZD,LE,1000)             
/*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: JCL Split IF more than 200 Steps

Postby Ed Goodman » Tue Mar 11, 2014 8:56 pm

Would it make more sense to change the input parms to PKZIP so that it does each person separately?
Ed Goodman
 
Posts: 342
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post