Splitting the records based on conditions



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Re: Splitting the records based on conditions

Postby vnktrrd » Thu Mar 31, 2011 7:14 pm

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.
vnktrrd
 
Posts: 7
Joined: Thu Mar 31, 2011 12:32 am
Has thanked: 0 time
Been thanked: 0 time

Re: Splitting the records based on conditions

Postby enrico-sorichetti » Thu Mar 31, 2011 7:27 pm

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 !
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: 3002
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Splitting the records based on conditions

Postby vnktrrd » Thu Mar 31, 2011 8:48 pm

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.
vnktrrd
 
Posts: 7
Joined: Thu Mar 31, 2011 12:32 am
Has thanked: 0 time
Been thanked: 0 time

Re: Splitting the records based on conditions

Postby Frank Yaeger » Thu Mar 31, 2011 10:38 pm

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?
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Splitting the records based on conditions

Postby amolpawarr » Thu Feb 28, 2013 9:51 am

Hi,

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


Regards,
Amol Pawar
amolpawarr
 
Posts: 1
Joined: Thu Feb 28, 2013 9:48 am
Has thanked: 0 time
Been thanked: 0 time

Re: Splitting the records based on conditions

Postby BillyBoyo » Thu Feb 28, 2013 11:33 am

I have updated the link in Frank Yaeger's post. Please click on it again. Thanks for letting us know.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Previous

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post