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
 
Searching in a string for a variable

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
deepak.kec

New User


Joined: 26 Feb 2007
Posts: 71
Location: bangalore

PostPosted: Mon Aug 17, 2009 5:46 pm    Post subject: Searching in a string for a variable
Reply with quote

Hi All,

I have a PS file in which i want to search a variable starting with "XXX". When it finds the XXX it should display next 6 character present right to "XXX" along with "XXX" in the output file.

Please suggest on this...
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8618
Location: Back in jolly old England

PostPosted: Mon Aug 17, 2009 5:48 pm    Post subject:
Reply with quote

What have you tried so far, and what errors have you encountered.
Back to top
View user's profile Send private message
deepak.kec

New User


Joined: 26 Feb 2007
Posts: 71
Location: bangalore

PostPosted: Mon Aug 17, 2009 5:51 pm    Post subject:
Reply with quote

I have tried using SUBSTR to display the string if it finds "XXX" but it is displaying whole string. I want it to display only next 6 character after "XXX"
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8618
Location: Back in jolly old England

PostPosted: Mon Aug 17, 2009 5:59 pm    Post subject:
Reply with quote

Show us how you have coded your substring
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1250
Location: Israel

PostPosted: Mon Aug 17, 2009 7:08 pm    Post subject:
Reply with quote

Show us too how you have coded your variable search.
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2088
Location: Silicon Valley

PostPosted: Mon Aug 17, 2009 9:22 pm    Post subject: Reply to: Searching in a string for a variable
Reply with quote

Hint:
Use the POS builtin function to see if it is there and also to get the offset. And use the offset in SUBSTR.
Back to top
View user's profile Send private message
deepak.kec

New User


Joined: 26 Feb 2007
Posts: 71
Location: bangalore

PostPosted: Tue Aug 18, 2009 2:48 pm    Post subject:
Reply with quote

Thanks to all. I have found a solution using DFSORT in JCL.
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm
This topic is locked: you cannot edit posts or make replies. Can a alphanumeric data be moved to a... nico_neoz COBOL Programming 10 Mon Oct 30, 2017 8:28 am
No new posts line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm

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