IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Searching in a string for a variable


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Mon Aug 17, 2009 5:48 pm
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
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: 8797
Location: Welsh Wales

PostPosted: Mon Aug 17, 2009 5:59 pm
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: 1353
Location: Israel

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

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

Global Moderator


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

PostPosted: Mon Aug 17, 2009 9:22 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Variable Output file name DFSORT/ICETOOL 8
Search our Forums:

Back to Top