Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Include/Omit recs with a specific char anywhere in a field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Hariatharland

New User


Joined: 22 Dec 2008
Posts: 2
Location: USA

PostPosted: Thu Jan 21, 2010 12:53 am    Post subject: Include/Omit recs with a specific char anywhere in a field
Reply with quote

Can I write a sort step which will omit/include recs with a particular char/string (example: 'N/A') anywhere in WS-VAR PIC X(100).

WS-VAR
---------
abcdefgh n/a - omit
n/a abahgehv - omit
asdn/aasjdjnm - omit
asdkajsdkjkak - include
asdjhasdk - include
asdb ascasc - include
- include

I don't want to write include statement which searches N/A in every 3 bytes starting from 1 - 100, where i would end up writing 97 or conditions.
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Jan 21, 2010 3:08 am    Post subject:
Reply with quote

Hi,

try this
Code:
//S1       EXEC PGM=SORT                     
//SYSOUT   DD SYSOUT=*                       
//SORTIN   DD DSN=input-file                 
//SORTOUT  DD SYSOUT=*                       
//SYSIN    DD *                             
  OPTION COPY                               
  INCLUDE COND=(1,100,SS,EQ,C'N/A')         
/*                                           


Gerry
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Jan 21, 2010 10:01 am    Post subject:
Reply with quote

Just to tell you.. n/a is not equal to N/A
Quote:
abcdefgh n/a - omit

and
Quote:

statement which searches N/A in every 3 bytes starting from 1 - 100
Back to top
View user's profile Send private message
Hariatharland

New User


Joined: 22 Dec 2008
Posts: 2
Location: USA

PostPosted: Thu Jan 21, 2010 9:18 pm    Post subject:
Reply with quote

Guys,
Thanks for your time.

Sorry, I assumed Substring 'SS' would not work. I was wrong.
But I could have tried it before posting.

Thanks anyways.
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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts For each given key value, how to keep... Div Grad DFSORT/ICETOOL 7 Fri Nov 11, 2016 11:38 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us