str = 'a_b-term=2004F'
parse var str 1 'term=' value
if value > '' then say value; else say 'no value';
exit 0
</code
What i need is value only if 'term=' starts in column 1; if term=
is found after col 1 then ignore it. . .
REXX returns value = 2004F; Is there a way to parse from col 1 only? I
need to ignore term= if it starts after
col1
bobh
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX
With this as your example text string
str = 'a_b-term=2004F'
Try this;
If Left(Str,5) = 'term=' Then Parse Var Str 'term=' Value .
str = 'a_b-term=2004F'
If pos('term=',str) = '1' Then Do
parse var str 1 'term=' value
if value > '' then say value; else say 'no value';
End
"Hamilton, Robert
L"
<roberth@UTDALLAS To
.EDU> TSO-...@VM.MARIST.EDU
Sent by: TSO REXX cc
Discussion List
<TSO-...@VM.MARI Subject
ST.EDU> Parse
12/06/2004 10:52
AM
Please respond to
TSO REXX
Discussion List
<TSO-...@VM.MARI
ST.EDU>
Thnx
bobh
-
Parse Var Str 1 str1 6 Value
If Str1 \= 'term=' Then <do what you do to ignore this>
-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf
Of Hamilton, Robert L
Sent: Monday, December 06, 2004 9:18 AM
To: TSO-...@VM.MARIST.EDU
Subject: Re: Parse
William & doug; looks like either will be the way but I was hoping to
get PARSE to start in column 1, without the extra code.
Thnx
bobh
----------------------------------------------------------------------
str = 'a_b-term=2004F'
parse var str junk 'term=' value
if junk == '' and value > '' then say value; else say 'no value';
If you wish to permit leading blanks in the string preceding
the 'term=', then change the double == to a single = above.
- seb
-----Original Message-----
From: Hamilton, Robert L
Sent: Monday, December 06, 2004 11:53 AM
To: TSO-...@VM.MARIST.EDU
Subject: Parse
Here's a parse opportunity for some one:
<code>
/* main REXX program */
str = 'a_b-term=2004F'
parse var str 1 'term=' value
if value > '' then say value; else say 'no value';
exit 0
</code
What i need is value only if 'term=' starts in column 1; if term= is
found after col 1 then ignore it. . .
REXX returns value = 2004F; Is there a way to parse from col 1 only? I
need to ignore term= if it starts after col1
----------------------------------------------------------------------