MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
psmadhusudhan Beginner Joined: 28 Nov 2006 Posts: 143 Topics: 48
Posted: Fri Oct 25, 2019 6:59 am Post subject: Blank record out of sort
Hi friends,
We are trying below sort card on a file to prepare output records based on input file values.
Code: SORT FIELDS=COPY
OUTFIL IFTHEN=(WHEN=(37,1,CH,EQ,C'Z'),BUILD=(C'5050 ',/, -
C'5151 ')), -
IFTHEN=(WHEN=(37,1,CH,EQ,C'D'),BUILD=(C'5343 ')), -
IFTHEN=(WHEN=(37,1,CH,EQ,C'C'),BUILD=(C'5135 '))
If 37 character is not either Z or D or C then one blank record in written in the output file.
Can you please guide us how to avoid blank record. _________________ Thanks
Madhu Sudhan
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
Posted: Fri Oct 25, 2019 8:39 am Post subject:
psmadhusudhan ,
Depends on what you want to do if you find a record that has a value other than Z,D,C.
1. If you only want Z,D,C records to be processed then add an INCLUDE cond to only process Z,D,C records
Code:
INCLUDE COND=(37,1,SS,EQ,C'C,D,Z')
2. If you decide to process other value records, then you need to another IFTHEN=(WHEN=NONE
Code:
IFTHEN=(WHEN=NONE,BUILD=(C'OTHER RECORDS'))
_________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
psmadhusudhan Beginner Joined: 28 Nov 2006 Posts: 143 Topics: 48
Posted: Wed Oct 30, 2019 1:03 am Post subject:
Thanks Kolusu. INCLUDE COND worked fine and blank record is not coming in output.
Sorry for delay in reply as just now back from Diwali holidays. _________________ Thanks
Madhu Sudhan
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