MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

To Change data in members in a PDS

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
roger29
Beginner


Joined: 25 Nov 2004
Posts: 4
Topics: 2

PostPosted: Thu Nov 25, 2004 7:20 am    Post subject: To Change data in members in a PDS Reply with quote

Hi,

i have a PDS (say PDS1) with members having multiple lines.One of those lines have two parameter fields as &&AAA and &&BBB.
Also have a sequential file (say file1) with a single record having two date values

20010701 20010901

Now, i need to to copy all the members in PDS1 to an another PDS named to PDS2 and replace &&AAA with '2001-07-01' and and &&BBB with '2001-09-01' present in the file1.

think this could be accomplished in batch by executing a REXX routine through JCL.
Could anybody provide me a REXX routine to accomplish this? i am not very familiar with REXX.

Is there any other way perform the above without using rexx?

Thanks
-Roger
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Nov 25, 2004 10:16 am    Post subject: Reply with quote

Roger29,

U can achieve the desired result using 3 small macros.

Macro # 1: NAME: REPLMEM
Code:

/*   REXX   */                                   
  CALL   OUTTRAP  "TRAP."                         
 "LISTD" 'T.PDS1' "MEMBERS"                       
  CALL   OUTTRAP  "OFF"                           
 /* * * * * * * * * * * * * * * * * * * * */     
 /*     POSITION THE POINTER TO THE       */     
 /*       BEGINNING OF MEMBER LIST        */     
 /* * * * * * * * * * * * * * * * * * * * */     
                                                 
  DO I = 1 TO TRAP.0                             
       IF TRAP.I = "--MEMBERS--" THEN             
             LEAVE                               
  END                                             
  MBR_COUNT = TRAP.0 - I                         
  I = I + 1                                       
                                                 
  DO J = I TO TRAP.0                             
       PARSE VALUE TRAP.J WITH MEMBER_NAME       
       MEMBER_NAME = STRIP(MEMBER_NAME)           
       OLD_DSN     = "'T.PDS1("||MEMBER_NAME||")'"
       NEW_DSN     = "'T.PDS2("||MEMBER_NAME||")'"         
      "ISPEXEC VIEW DATASET("||OLD_DSN||") MACRO(CUTCOPY)"
      "ISPEXEC EDIT DATASET("||NEW_DSN||") MACRO(RPASTE)" 
  END                                                     
EXIT 0                                                     


MACRO # 2: NAME: CUTCOPY
Code:

/*   REXX    */                           
 "ISREDIT MACRO"                           
 "ISREDIT CUT .ZF .ZL CLIPBRD REPLACE"     
 "ISREDIT BUILTIN CANCEL"                 
  RETURN                                   


MACRO # 3: NAME: RPASTE
Code:

 "ISREDIT MACRO"                                 
 "ISREDIT PASTE   CLIPBRD AFTER .ZCSR DELETE"   
 "ISREDIT SCAN OFF"                             
 "ISREDIT CHANGE  ALL '&&AAA'  '2001-07-01'"     
 "ISREDIT CHANGE  ALL '&&BBB'  '2001-09-01'"     
 "ISREDIT CHANGE  ALL '&&2001' '2001'"           
 "ISREDIT END"                                   
  RETURN                                         


All you need to do is to execute REPLMEM (TSO REPLMEM). It will invoke the other two macros. The new pds PDS2 must be created before invoking the REPLMEM macro. Just create a empty PDS. It will create the members.

Hope this helps,

Thanks,
Phantom
Back to top
View user's profile Send private message
roger29
Beginner


Joined: 25 Nov 2004
Posts: 4
Topics: 2

PostPosted: Fri Nov 26, 2004 8:52 am    Post subject: Reply with quote

Thanks Phantom

-Roger
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group