MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
mickeygoo Beginner Joined: 15 Nov 2007 Posts: 26 Topics: 7
Posted: Thu Jul 02, 2009 10:30 am Post subject: Multiple IFTHEN w/ HIT=NEXT, skip if no cond satisfied
Hope this makes sense...
1 SORTIN rec, possible multiple SORTOUT recs, depending on field values
SORTIN:
FLDA ... FLDB ... FLDC ... FLDD
IF FLDA > 0 create SORTOUT type1 rec, HIT=NEXT
IF FLDB > 0 create SORTOUT type2 rec, HIT=NEXT
IF FLDC > 0 create SORTOUT type3 rec, HIT=NEXT
IF FLDD > 0 create SORTOUT type4 rec, HIT=NEXT
IF none satisfied (WHEN=NONE), skip record
Right now, if I don't code a WHEN=NONE, the SORTIN record is copied to SORTOUT.
I've thought of "pre-sorting" the file to exclude those records that do not satisfy any of the above condition... but maybe there's a cooler way.
Ideas? TIA...
Back to top
mickeygoo Beginner Joined: 15 Nov 2007 Posts: 26 Topics: 7
Posted: Thu Jul 02, 2009 10:32 am Post subject:
Sorry, by "pre-sort", I mean use an "INCLUDE" condition... _________________ Not an expert, but I did stay at a Holiday Inn... though it has been a while...
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Thu Jul 02, 2009 10:43 am Post subject:
mickeygoo,
An INCLUDE COND would be a better choice here
Code:
//SYSIN DD *
INCLUDE COND=(P1,M1,F1,GT,0,OR,
P2,M2,F2,GT,0,OR,
P3,M3,F3,GT,0,OR,
P4,M4,F4,GT,0)
SORT FIELDS=COPY
INREC IFTHEN....
_________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum