MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Multiple IFTHEN w/ HIT=NEXT, skip if no cond satisfied

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
mickeygoo
Beginner


Joined: 15 Nov 2007
Posts: 26
Topics: 7

PostPosted: Thu Jul 02, 2009 10:30 am    Post subject: Multiple IFTHEN w/ HIT=NEXT, skip if no cond satisfied Reply with quote

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... Very Happy
Back to top
View user's profile Send private message
mickeygoo
Beginner


Joined: 15 Nov 2007
Posts: 26
Topics: 7

PostPosted: Thu Jul 02, 2009 10:32 am    Post subject: Reply with quote

Sorry, by "pre-sort", I mean use an "INCLUDE" condition... bonk
_________________
Not an expert, but I did stay at a Holiday Inn... though it has been a while...
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Jul 02, 2009 10:43 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group