Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us