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
 
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 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 ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm

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