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
 
JCL to search a string

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
rahuindo

New User


Joined: 09 Apr 2008
Posts: 83
Location: Chennai

PostPosted: Tue Sep 24, 2013 3:49 am    Post subject: JCL to search a string
Reply with quote

Hi,
I have an input VB QSAM file and I need to copy the records which are having the string "RA00PF" or "RA00FP". These 2 strings can occur between the position 10 and 200 and are of 6-bytes in length. Currently, I am doing using the following:

Code:

// '          ORIF=(10,EQ,C''RA00PF''),   ',
// '          ORIF=(10,EQ,C''RA00FP''),   ',
// '          ORIF=(16,EQ,C''RA00PF''),   ',
// '          ORIF=(16,EQ,C''RA00FP''),   ',
// '          ORIF=(22,EQ,C''RA00PF''),   ',
// '          ORIF=(22,EQ,C''RA00FP''),   ',
// '          ORIF=(28,EQ,C''RA00PF''),   ',
// '          ORIF=(28,EQ,C''RA00FP''),   ',
// '          ORIF=(34,EQ,C''RA00PF''),   ',
// '          ORIF=(34,EQ,C''RA00FP''),   ',
// '          ORIF=(40,EQ,C''RA00PF''),   ',
// '          ORIF=(40,EQ,C''RA00FP''),   ',

Is there a better way of doing this through JCL?
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Sep 24, 2013 4:01 am    Post subject: Reply to: JCL to search a string
Reply with quote

Not with JCL.

You can do it with your SORT product, which we know is SyncSort

Code:
  INCLUDE COND=(6,195,SS,EQ,C'RA00PF',
             OR,6,195,SS,EQ,C'RA00FP')
Back to top
View user's profile Send private message
rahuindo

New User


Joined: 09 Apr 2008
Posts: 83
Location: Chennai

PostPosted: Tue Sep 24, 2013 4:14 am    Post subject: Reply to: JCL to search a string
Reply with quote

Thanks Bill. How will this work? As per my knowledge, "6" corresponds to the starting position and 195 will be the lenght of the string. So, will the above condition start searching at 6th position and look for the character "RAA0PF" for the next 195 bytes?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Sep 24, 2013 4:43 am    Post subject: Reply to: JCL to search a string
Reply with quote

Yes, I didn't read your post clearly enought. So change the start and the length appropriately. Make sure you test values at and beyond the extremes.

The SS does a "Sub String" search for the character value being present anywhere within the field.

SS is even cleverer than that:

Code:
(1,1,SS,EQ,C'A,B,C')


Will search of any value of A, B or C in the one-byte field at position one. Look it up in your manual. Experiment.
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm
No new posts String after '.' (period) is not copy... balaji81_k SYNCSORT 6 Wed Aug 23, 2017 9:35 pm
No new posts change string before sertan string anatol DFSORT/ICETOOL 8 Tue Aug 15, 2017 5:43 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm

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