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 

Change member content in a PDS

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


Joined: 25 Nov 2004
Posts: 4
Topics: 2

PostPosted: Fri Nov 26, 2004 9:03 am    Post subject: Change member content in a PDS Reply with quote

Hi,

Sorry for posting the below problem once again. I got a good solution in REXX in this forum.

But still trying to find out if it could be achieved by running some utilities(IEBUPDTE or Fileaid)UB through JCL :

i have a PDS (say USERID.PDS1) with members having multiple lines.
(Say
---------------
---------------
&&AAA and &&BBB)

One of those lines have two parameter fields as &&AAA and &&BBB.
Also i have a sequential file (say file1) with a single record having two date values which change every week

20010701 20010901

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


Thanks
-Roger
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sun Nov 28, 2004 9:26 pm    Post subject: Reply with quote

Roger29,

Fileaid can be used to copy the members as well as replace the contents while copying.

basically the following control cards will copy and replace the contents in the output PDS.
Code:

$$DD01 COPYMEM MEMBERS=*,                     
      EDITALL=(1,0,C'&&AAA',C'2001-07-01'),   
      EDITALL=(1,0,C'&&BBB',C'2001-09-01')   


Since your replacing contents are coming a sequential , you need to generate the control cards. The stepo100 will generate the control cards shown above reading your sequential file. Now step0200 will use the generated control cards and produce the desired results.

Code:

//STEP0100 EXEC PGM=FILEAID   
//SYSPRINT DD SYSOUT=*       
//SYSLIST  DD SYSOUT=*       
//DD01     DD *               
20010701 20010901             
//DD01O    DD DSN=&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
//SYSIN    DD *                                   
$$DD01 USER MOVE=(1,80C' '),                     
  MOVE=(1,C'$$DD01 COPYMEM MEMBERS=*,'),           
  WRITE=DD01O,OUT=1,                               
  MOVE=(1,80C' '),                                 
  MOVE=(7,C'EDITALL=(1,0,C'),                     
  MOVE=(+0,C"'&&AAA',C'"),                         
  MOVE=(+0,4,1),                                   
  MOVE=(+0,C'-'),                                 
  MOVE=(+0,2,5),                                   
  MOVE=(+0,C'-'),                                 
  MOVE=(+0,2,7),                                   
  MOVE=(+0,C"'),"),                               
  WRITE=DD01O,OUT=1,                               
  MOVE=(1,80C' '),                 
  MOVE=(7,C'EDITALL=(1,0,C'),     
  MOVE=(+0,C"'&&BBB',C'"),         
  MOVE=(+0,4,10),                 
  MOVE=(+0,C'-'),                 
  MOVE=(+0,2,14),                 
  MOVE=(+0,C'-'),                 
  MOVE=(+0,2,16),                 
  MOVE=(+0,C"')"),                 
  WRITE=DD01O,OUT=1               
/*
//STEP0200 EXEC PGM=FILEAID,REGION=4M
//SYSPRINT DD  SYSOUT=*               
//SYSLIST  DD  SYSOUT=*               
//DD01     DD  DSN=USERID.PDS1,   
//             DISP=SHR               
//DD01O    DD  DSN=USERID.PDS2,   
//             DISP=SHR               
//SYSIN    DD  DSN=&T1,DISP=OLD       


Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
roger29
Beginner


Joined: 25 Nov 2004
Posts: 4
Topics: 2

PostPosted: Tue Nov 30, 2004 2:28 am    Post subject: Reply with quote

Hi Kolusu

Your solution is great !!! It worked fine with me.

Thanks a lot
-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 -> Utilities 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