Page 2 of 2

Re: Splitting the records based on conditions

PostPosted: Thu Mar 31, 2011 7:14 pm
by vnktrrd
Hi Frank,

Yes I did not notice the numbers.

The JCL you gave below will work for 124000 records.But in my scenarion I am not sure about the number for records in the input file.

Thank You.

Re: Splitting the records based on conditions

PostPosted: Thu Mar 31, 2011 7:27 pm
by enrico-sorichetti
then the only way is to run a three stage process

1) count the records in the input file
2) build the final jcl with the proper number of output files
3) run the jcl just built submitting it thru the internal reader

but first of all learn to describe properly Your issues
what if the input file contains 10 millions records
would You have to split it in 200 files !

Re: Splitting the records based on conditions

PostPosted: Thu Mar 31, 2011 8:48 pm
by vnktrrd
Hi,

I have seen the following JCL in the sort tricks.

//GENJCL1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DATA,DLM=$$
//CPYFILES JOB (XXX,005),'PRGMR',CLASS=A,MSGCLASS=H,
// MSGLEVEL=(1,1),TIME=(,15)
//S1 EXEC PGM=ICEGENER
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD DSN=&OUT,DISP=(,PASS),SPACE=(CYL,(5,5)),UNIT=SYSDA
//SYSIN DD DUMMY
$$
//SORTOUT DD DSN=&T1,UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(,PASS)
//SYSIN DD *
* Copy JOB, EXEC, SYSPRINT, SYSUT2 and SYSIN statements.
OPTION COPY
/*
//GENJCL2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SORTIN DD DSN=... list of file names
//TEMP DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),
//** USE MOD FOR T1
// DISP=(MOD,PASS)
//SYSIN DD *
OPTION COPY
* Add sequence numbers to file list so we can identify the
* first file in the list and use '//SYSUT1 DD' for it.
* We'll use '// DD' for the second and subsequent files
* in the list.
OUTREC BUILD=(1,44, file name from list
81:SEQNUM,3,ZD) sequence number
* Generate //SYSUT1 DD DISP=SHR,DSN=name1
* // DD DISP=SHR,DSN=name2
* ...
OUTFIL FNAMES=TEMP,
IFOUTLEN=80,
IFTHEN=(WHEN=INIT,
BUILD=(1:C'//',10:C'DD DISP=SHR,DSN=',1,44,81:81,3)),
IFTHEN=(WHEN=(81,3,ZD,EQ,+1),OVERLAY=(3:C'SYSUT1'))
/*
//SUBJCL EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&T1,DISP=(OLD,PASS)
//SORTOUT DD SYSOUT=(A,INTRDR) internal reader
//SYSIN DD *
* Submit the JCL to the internal reader
OPTION COPY
/*


here in this JCL i cannot understand two things.

//SORTIN DD DSN=... list of file names
what are the "list of file names" I should give here?

OUTREC BUILD=(1,44, file name from list
81:SEQNUM,3,ZD) sequence number
what are the "file names from list" and "sequence number" I should give here?

please help.

Re: Splitting the records based on conditions

PostPosted: Thu Mar 31, 2011 10:38 pm
by Frank Yaeger
vnktrrd,

I gave you a solution based on your description of your requirement.

Now you come back and say you have a different requirement which I already discussed previously:

You could modify the job I gave you to use the technique discussed in the "Split a file to n output files dynamically" Smart DFSORT Trick at:

http://www-01.ibm.com/support/docview.w ... g3T7000094


Did you even look at that Smart DFSORT Trick to see if it would help in your situation?

Re: Splitting the records based on conditions

PostPosted: Thu Feb 28, 2013 9:51 am
by amolpawarr
Hi,

Can anyone provide the document provide on 'http://www.ibm.com/support/docview.wss? ... g3T7000094' link.


Regards,
Amol Pawar

Re: Splitting the records based on conditions

PostPosted: Thu Feb 28, 2013 11:33 am
by BillyBoyo
I have updated the link in Frank Yaeger's post. Please click on it again. Thanks for letting us know.