Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: to fetch a Mem. name frm a File and to OPEN mem. & edit
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: 2360
Location: Israel

PostPosted: Tue Dec 26, 2006 2:35 pm    Post subject:
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    Post subject: hi
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    Post subject: hi
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: 2360
Location: Israel

PostPosted: Tue Dec 26, 2006 5:16 pm    Post subject:
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    Post subject: hi
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 11 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us