View previous topic :: View next topic
|
Author |
Message |
amolj
New User
Joined: 08 Nov 2006 Posts: 21 Location: india
|
|
|
|
hi guys....
Following is my requirement.....
i have a sequential file containing the names of members from a PDS ....
i want to read the file and fetch the member name ... now i want to open this member from corresponding PDS and edit ... it ...
how can i use LMMLIST for my above requirement... actually i was able to open the members from the required PDS and edit those sequentially using REXX...
but i want to read the member name from file and open the corresponding PDS ... i m not getting it ....
please help me ... |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
I believe the best solution would be an Edit-Macro.
O. |
|
Back to top |
|
|
amolj
New User
Joined: 08 Nov 2006 Posts: 21 Location: india
|
|
|
|
can u tell me the syntax for Parse Statement... |
|
Back to top |
|
|
amolj
New User
Joined: 08 Nov 2006 Posts: 21 Location: india
|
|
|
|
hi . ...
if define a variable in REXX Prog can i use it in the macro which i m calling in my rexx program..... |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Yes, either via PARMS or using ISPF variables services (VGET/VPUT).
O. |
|
Back to top |
|
|
amolj
New User
Joined: 08 Nov 2006 Posts: 21 Location: india
|
|
|
|
following is my requirement...
my REXX Program .......
This code opens a PDS .. and opens up a member of that PDS in EDIT Mode ... it also reads a sequential file containing the comments and name of PDS members .....
REXX Program
Code: |
/************************ REXX ********************************/
/* EDIT ALL MEMBERS OF THE CURRENTLY ALLOCATED PDS EXCEPT THE */
/* MEMBER BEING EDITED. PASS NAME OF EDIT MACRO AS ONLY PARM. */
/**************************************************************/
"ISREDIT MACRO (CMMNT)"
/* IDENTIFY CURRENTLY OPEN PDS */
"ISREDIT (OPENPDS) = DATAID"
/* IDENTIFY CURRENTLY OPEN MEMBER */
"ISREDIT (OPENMBR) = MEMBER"
/* OPEN PDS FOR INPUT */
ADDRESS TSO
"ALLOC MOD DA('TEBTOTS.EFT.DSN4') F(INDD) "
SAVERC = 0
DONE = 'NO'
DO WHILE DONE='NO'
/*OPEN SEQ FILE TO READ MEM NAME AND COMMENT*/
ADDRESS TSO
"EXECIO * DISKR INDD"
PULL RECORD
PARSE VAR RECORD MBR ' ' CMMNT
SAY 'MEMBER NAME =' MBR
SAY 'COMMENT LINE =' CMMNT
IF MBR = 'LAST' THEN DO
DONE='YES'
END
/*OPEN PDS MEM*/
/*MBR = 'EFABREXX'*/
ADDRESS ISPEXEC
"LMOPEN DATAID("OPENPDS") OPTION(INPUT)"
"LMMLIST DATAID("OPENPDS") MEMBER(MBR) OPTION(LIST) STATS(NO)"
SAVERC = RC
IF (SAVERC = 0) & (MBR \= OPENMBR) THEN DO
"EDIT DATAID("OPENPDS") MEMBER("MBR") MACRO(READNEW2)"
END
ADDRESS ISPEXEC
"LMMLIST DATAID("OPENPDS") OPTION(FREE)"
"LMCLOSE DATAID("OPENPDS")"
END
/* FREE AND CLOSE PDS */
ADDRESS TSO
"FREE DDNAME(INDD)"
EXIT
|
this program ... runs a macro READNEW2 in to every MEMBER of the PDS...
now I want to use the Field CMMNT from this rexx prgm in the macro READNEW2
MACRO - READNEW2
Code: |
/* REXX */
"ISREDIT MACRO (CMMNT)"
STRING = "PROCLIB"
SAY 'READNEW2 - COMMENT =' CMMNT
IF CMMNT='COMMENT' THEN DO
"ISREDIT F FIRST" (STRING)
ADDRESS ISREDIT "(FRED) = "CURSOR
ADDRESS ISREDIT "LINE_BEFORE "FRED"=
'//***************************************************
END
ELSE DO
"ISREDIT F FIRST" (STRING)
ADDRESS ISREDIT "(FRED) = "CURSOR
ADDRESS ISREDIT "LINE_BEFORE "FRED"=(CMMNT)"
END
ADDRESS ISREDIT "END"
EXIT
|
............
value from the field CMMNT is to be written in to the member of the pds... but when i display the field CMMNT in the macro i m not getting the value ...although the say statement in the rexx prgm shows the correct value of the field CMMNT. |
|
Back to top |
|
|
|