Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Multiple OUTFIL in one sort

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

New User


Joined: 10 Nov 2006
Posts: 19
Location: New York

PostPosted: Tue Oct 28, 2008 12:36 am    Post subject: Multiple OUTFIL in one sort
Reply with quote

i am trying to take one sort in file, create two sort out. Sortof1 is the exact copy of sortin. Sortof2 is 1) reformat two fields, and 2) change the value of field B depending on value of field A.

I have

Code:

 SORT FIELDS=(1,8,CH,A,41,10,CH,A,30,10,CH,A)
 OUTFIL FNAMES=SORTOF1                       
 OUTFIL FNAMES=SORTOF2,                       
 IFTHEN=(WHEN=(9,5,PD,EQ,016950409),         
      OVERLAY=(14:X'023447398C')),           
 IFTHEN=(WHEN=(9,5,PD,EQ,019799650),         
      OVERLAY=(14:X'023447399C')),           
 IFTHEN=(WHEN=(9,5,PD,EQ,021090224),         
      OVERLAY=(14:X'023447397C'))         


I cannot figure out how to fold into sortof2 (change 9,5,pd to bi, change 14,5,pd,bi).
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: Tue Oct 28, 2008 1:13 am    Post subject:
Reply with quote

You can use HIT=NEXT for your existing clauses, and add WHEN=ANY and WHEN=NONE clauses. Something like this:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOF1 DD DSN=...  output file1
//SORTOF2 DD DSN=...  output file2
//SYSIN    DD    *
  SORT FIELDS=(1,8,CH,A,41,10,CH,A,30,10,CH,A)
  OUTFIL FNAMES=SORTOF1
  OUTFIL FNAMES=SORTOF2,
     IFTHEN=(WHEN=(9,5,PD,EQ,016950409),
        OVERLAY=(14:X'023447398C'),HIT=NEXT),
     IFTHEN=(WHEN=(9,5,PD,EQ,019799650),
        OVERLAY=(14:X'023447399C'),HIT=NEXT),
     IFTHEN=(WHEN=(9,5,PD,EQ,021090224),
        OVERLAY=(14:X'023447397C'),HIT=NEXT),
     IFTHEN=(WHEN=ANY,
       OVERLAY=(9:9,5,PD,TO=BI,LENGTH=5,
               14:14,5,PD,TO=BI,LENGTH=5)),
     IFTHEN=(WHEN=NONE,
       OVERLAY=(9:9,5,PD,TO=BI,LENGTH=5,
               14:14,5,PD,TO=BI,LENGTH=5))
/*
Back to top
View user's profile Send private message
ywheeler

New User


Joined: 10 Nov 2006
Posts: 19
Location: New York

PostPosted: Tue Oct 28, 2008 5:49 pm    Post subject:
Reply with quote

wow. thanks so much.
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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us