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

to fetch a Mem. name frm a File and to OPEN mem. & edit


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

New User


Joined: 08 Nov 2006
Posts: 21
Location: india

PostPosted: Tue Dec 26, 2006 12:58 pm
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Dec 26, 2006 2:35 pm
Reply with quote

I believe the best solution would be an Edit-Macro.

O.
Back to top
View user's profile Send private message
amolj

New User


Joined: 08 Nov 2006
Posts: 21
Location: india

PostPosted: Tue Dec 26, 2006 2:56 pm
Reply with quote

can u tell me the syntax for Parse Statement...
Back to top
View user's profile Send private message
amolj

New User


Joined: 08 Nov 2006
Posts: 21
Location: india

PostPosted: Tue Dec 26, 2006 4:20 pm
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Dec 26, 2006 5:16 pm
Reply with quote

Yes, either via PARMS or using ISPF variables services (VGET/VPUT).

O.
Back to top
View user's profile Send private message
amolj

New User


Joined: 08 Nov 2006
Posts: 21
Location: india

PostPosted: Tue Dec 26, 2006 5:45 pm
Reply with quote

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
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 How to split large record length file... DFSORT/ICETOOL 9
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top