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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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