parsing a line into stem



IBM's Command List programming language & Restructured Extended Executor

parsing a line into stem

Postby senthil » Sat Aug 01, 2009 6:17 pm

hi all,
i have a line say "if cust_id = ' ' then". i am passing this line to a sub routine.
    myline = 'if cust_id = xyz then'
       call mod_line    myline
 



mod_line:
parse arg var1 var2 var3 var4 var5

now instead of parsing into var1 var2 and so on...
is it possible to have it in a stem and access it whenever i wanted?
if so please provide me with a solution...
Thanks
Senthil Kumar
senthil
 
Posts: 12
Joined: Mon Jun 01, 2009 3:23 pm
Has thanked: 0 time
Been thanked: 0 time

Re: parsing a line into stem

 

Re: parsing a line into stem

Postby expat » Sat Aug 01, 2009 7:46 pm

Have you tried
mod_line:
aa = aa +1
parse arg var1.aa var2.aa var3.aa var4.aa var5.aa
expat
 
Posts: 382
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 1 time

Re: parsing a line into stem

Postby senthil » Sun Aug 02, 2009 5:21 pm

hi expat,
That was a good one, but if i am not sure that how many words i am going to have in the line that is aa was used 5 times since we knew the number of words in the line,if we dont know the number of words then ?
i want something like
mod_line:
parse arg var.

so that no matter how many words in that line should be parsed into var.
do i = 1 to var.0
    say var.i
end

var.1 should have the first word and so on,
the above mentioned code is the task.but how am i gonna PARSE , its left with you all.
Thanks
Senthil Kumar
senthil
 
Posts: 12
Joined: Mon Jun 01, 2009 3:23 pm
Has thanked: 0 time
Been thanked: 0 time

Re: parsing a line into stem

Postby expat » Mon Aug 03, 2009 3:05 pm

Why not try to parse a line with a variable number of inputs yourself and see what happens

It's easy enough and far quicker than waiting for someone else to do it for you
expat
 
Posts: 382
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 1 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post