IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Multiple OUTFIL in one sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Tue Oct 28, 2008 1:13 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top