Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
using OUTFIL getting only required no. of recs for each file

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

New User


Joined: 01 Dec 2007
Posts: 21
Location: Hyderabad

PostPosted: Wed Mar 12, 2008 3:41 pm    Post subject: using OUTFIL getting only required no. of recs for each file
Reply with quote

Hi,
My requirement is this. I have an input file like this :

11111
11111
11111
22222
22222
33333
33333

I am copying subsets of records into different output files using OUTFIL.
But, my requirement is to copy different no. of records for different files.

Eg :

Code:
//SYSIN DD *
         SORT   FIELDS=COPY
         OUTFIL FNAMES=OUT1,INCLUDE=(1,5,ZD,EQ,11111)
         OUTFIL FNAMES=OUT1,INCLUDE=(1,5,ZD,EQ,22222)
         OUTFIL FNAMES=OUT1,INCLUDE=(1,5,ZD,EQ,33333)
       /*

If use the above card, all "11111" records will go to file1; All "22222" records will go to file2; all "33333" records will go to file3;

But, my requirement is not to get all the records.
i would like to copy 3 records to file1; 2 records to file2; 1 record to file3.

is there any option with OUTFIL that can select only required no. of recs ?
(like, STOPAFT=n)

thanks
Back to top
View user's profile Send private message

zero

New User


Joined: 01 Dec 2007
Posts: 21
Location: Hyderabad

PostPosted: Wed Mar 12, 2008 3:43 pm    Post subject: Reply to: using OUTFIL getting only required no. of recs for
Reply with quote

Sorry, in the above sort card, Output DD names are OUT1, OUT2, OUT3.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Mar 12, 2008 9:28 pm    Post subject: Reply to: using OUTFIL getting only required no. of recs for
Reply with quote

zero wrote:
If use the above card, all "11111" records will go to file1; All "22222" records will go to file2; all "33333" records will go to file3;

But, my requirement is not to get all the records.
i would like to copy 3 records to file1; 2 records to file2; 1 record to file3.


zero,

Assuming that your data is already sorted on the key , here is a JCL which would give you the desired results

Code:

//STEP0100 EXEC PGM=ICEMAN                     
//SYSOUT   DD SYSOUT=*                         
//SORTIN   DD *                                 
11111                                           
11111                                           
11111                                           
22222                                           
22222                                           
33333                                           
33333                                           
//OUT1     DD SYSOUT=*                         
//OUT2     DD SYSOUT=*                         
//OUT3     DD SYSOUT=*                         
//SYSIN    DD *                                 
  SORT FIELDS=COPY                             
  OUTREC OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,5))
  OUTFIL FNAMES=OUT1,BUILD=(01,80),             
  INCLUDE=(1,5,CH,EQ,C'11111',AND,81,8,ZD,LE,3)
  OUTFIL FNAMES=OUT2,BUILD=(01,80),             
  INCLUDE=(1,5,CH,EQ,C'22222',AND,81,8,ZD,LE,2)
  OUTFIL FNAMES=OUT3,BUILD=(01,80),             
  INCLUDE=(1,5,CH,EQ,C'33333',AND,81,8,ZD,LE,1)
/*


If the data is not sorted then just change the sort fields statement to

Code:

 SORT FIELDS=(01,05,CH,A)
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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us