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

parsing the variables with the ~ separator


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vidyaa

New User


Joined: 02 May 2008
Posts: 77
Location: chennai

PostPosted: Wed Jun 11, 2008 11:06 am
Reply with quote

Hi,

can anyone tell me how to parse the variables having the ~ seperator and assign it to different varibles....the difficulty here is we will not know how many varibles are there in the record

ex:
input file is
AAA~DVDF~12324~
432434~FSD~

The number of varibles is not constant per line so we carnt use general parsing over the records....then what is the method of parsing these values and putting in as many number of varibles.

my outpput should be like
VAR1 = AAA
VAR2 = DVDF
VAR3 = 1234
VAR4 = 432434
VAR5 = FSD

Please help on the same
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Jun 11, 2008 11:14 am
Reply with quote

I do not see any DB2 relation...

What language do You want to use for parsing ?
Back to top
View user's profile Send private message
Sinkaravelan S

New User


Joined: 21 Apr 2008
Posts: 27
Location: coimbatore-TN india

PostPosted: Wed Jun 11, 2008 12:51 pm
Reply with quote

Hi Vidya,

Welcome to the forum!!!

pls refer this

www.kilowattsoftware.com/tutorial/rexx/parseTutorial.htm

Thanks,
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Jun 11, 2008 1:09 pm
Reply with quote

waiting for an acknowledgment from the TS in order to move the topic to the proper forum
Back to top
View user's profile Send private message
vidyaa

New User


Joined: 02 May 2008
Posts: 77
Location: chennai

PostPosted: Wed Jun 11, 2008 1:11 pm
Reply with quote

this is to deal with rexx
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Jun 11, 2008 1:26 pm
Reply with quote

why not post to the right forum to start with ?

I' ll move the topic where it belongs
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jun 11, 2008 2:25 pm
Reply with quote

If the number is unknown and the seperator is stable then I would use TRANSLATE rather than parse.

Count the seperate words left in the string, and do a definitive loop using that count.
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 Parsing Large JSON file using COBOL COBOL Programming 4
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
No new posts JCL with variables JCL & VSAM 1
No new posts parsing with startat and endbefr SYNCSORT 10
No new posts JCL Variables JCL & VSAM 1
Search our Forums:

Back to Top