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
 
Can we do this by sort?

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

New User


Joined: 30 Mar 2005
Posts: 12
Location: Hyderabad

PostPosted: Thu Dec 15, 2005 8:12 pm    Post subject: Can we do this by sort?
Reply with quote

Hi everybody,

I have a file whose attributes are PS, LRECL=80,FB
Based on the first four characters I need to copy the record to four output files. (Which have same attributes as input file)

Ex: if first four characters are 1010,this record should be copied to
Output file1,
If first four characters are 1020,this record should be copied to
Output file2 like wise I need to copy to four files

I can do it by outfil fnames & include cond

But if we code outfil & include all records which satisfy above condition will be copied but I want the each output files to contain maximum 100 records bcoz I need sample data not the entire records
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


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

PostPosted: Thu Dec 15, 2005 9:33 pm    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for. You'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) in order to use DFSORT's IFTHEN and OVERLAY functions. Only DFSORT has these functions, so if you don't have DFSORT, you won't be able to use them. If you do have DFSORT, but you don't have the Dec, 2004 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/pdug/

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//OUT1 DD DSN=...    output file1 (FB/80)
//OUT2 DD DSN=...    output file2 (FB/80)
//OUT3 DD DSN=...    output file3 (FB/80)
//OUT4 DD DSN=...    output file4 (FB/80)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(1,4,CH,EQ,C'1010'),OVERLAY=(81:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(1,4,CH,EQ,C'1020'),OVERLAY=(81:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(1,4,CH,EQ,C'1030'),OVERLAY=(81:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(1,4,CH,EQ,C'1040'),OVERLAY=(81:SEQNUM,8,ZD))
   OUTFIL FNAMES=OUT1,
      INCLUDE=(1,4,CH,EQ,C'1010',AND,81,8,ZD,LE,+100),
      BUILD=(1,80)
   OUTFIL FNAMES=OUT2,
      INCLUDE=(1,4,CH,EQ,C'1020',AND,81,8,ZD,LE,+100),
      BUILD=(1,80)
   OUTFIL FNAMES=OUT3,
      INCLUDE=(1,4,CH,EQ,C'1030',AND,81,8,ZD,LE,+100),
      BUILD=(1,80)
   OUTFIL FNAMES=OUT4,
      INCLUDE=(1,4,CH,EQ,C'1040',AND,81,8,ZD,LE,+100),
      BUILD=(1,80)
/*
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Thu Nov 04, 2010 1:57 am    Post subject:
Reply with quote

With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct,2010), you can now use DFSORT's new ACCEPT=n function to do this more easily like this:

Code:

//NEW   EXEC  PGM=ICEMAN                                       
//SYSOUT    DD  SYSOUT=* 
//SORTIN DD DSN=...  input file (FB/80)
//OUT1 DD DSN=...    output file1 (FB/80)
//OUT2 DD DSN=...    output file2 (FB/80)
//OUT3 DD DSN=...    output file3 (FB/80)
//OUT4 DD DSN=...    output file4 (FB/80)
//SYSIN    DD    *                                             
  OPTION COPY                                                 
  OUTFIL FNAMES=OUT1,INCLUDE=(1,4,CH,EQ,C'1010'),ACCEPT=100   
  OUTFIL FNAMES=OUT2,INCLUDE=(1,4,CH,EQ,C'1020'),ACCEPT=100   
  OUTFIL FNAMES=OUT3,INCLUDE=(1,4,CH,EQ,C'1030'),ACCEPT=100   
  OUTFIL FNAMES=OUT4,INCLUDE=(1,4,CH,EQ,C'1040'),ACCEPT=100   


For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

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