Page 1 of 1

REXX macro - To extract the data from PROC to REXX variable

PostPosted: Thu Oct 16, 2008 10:01 pm
by chidams78
Hi all,

My reqt is to read a line from PROC and get the contents in a REXX variable till the mentioned text through REXX macro.
If I want to get the symbolic variable used in PROC to be extracted in REXX variable after the qualifier FLDABC, my code will
The PROC line is //TST11IN DD DSN=ABC.TEST.FLDABC&SYMPM,DISP=SHR

Code
PARSE VAR FLDLINE FLDLN1 '.FLDABC&' FLDLN2
where FLDLINE will contain the whole line and FLDLN2 will contain the symbolic variable used after FLDABC qualifier.

The question is whether I can pass the FLDABC dynamically. Means can i store it in any rexx variable and can use it with parse.
The below mentioned code is not working.

TEXT1 = .FLDABC&
PARSE VAR FLDLINE FLDLN1  TEXT FLDLN2


Please suggest me how to solve this.

Thanks
Chidam

Re: REXX macro - To extract the data from PROC to REXX variable

PostPosted: Fri Oct 17, 2008 1:50 am
by MrSpock
Try this:

text = '.FLDABC&'
template = "fldln1 '"||text||"' fldln2 ',' ."
PARSE VAR FLDLINE template

Re: REXX macro - To extract the data from PROC to REXX varia

PostPosted: Thu May 21, 2020 3:25 am
by sergeyken
TEXT1 = ‘.’FLDABC’&’
PARSE VAR FLDLINE FLDLN1  (TEXT1) FLDLN2

Re: REXX macro - To extract the data from PROC to REXX varia

PostPosted: Fri May 22, 2020 1:11 am
by sergeyken
MrSpock wrote:Try this:

text = '.FLDABC&'
template = "fldln1 '"||text||"' fldln2 ',' ."
PARSE VAR FLDLINE template

Result should be equivalent to:
Template = FLDLINE

Re: REXX macro - To extract the data from PROC to REXX varia

PostPosted: Sat May 23, 2020 10:42 pm
by Pedro
Re: the title of this thread - "REXX macro"
and
The question is whether I can pass the FLDABC dynamically.


The poster flirts with the question of how to accept the parameter but perhaps does not know how to ask. You need to use the MACRO statement to accept the parameter.

From the ISPF editor primary command line, the user would type:
%myexec .FLDABC&



/* rexx */
ADDRESS ISREDIT
’MACRO (mysrchtext)
...
PARSE VAR FLDLINE FLDLN1  (mysrchtext) FLDLN2