Need to edit a member in multiple PDS.



IBM's Command List programming language & Restructured Extended Executor

Need to edit a member in multiple PDS.

Postby samurai » Tue Mar 25, 2014 4:14 pm

Hello,

i have a new requirement in which the datasets with the naming convention "RESETDB.*.*.AUDB41" has multiple PDS and in it we have to edit a member with same name DELdsn as C all Notify =jjjj to aaaa.
samurai
 
Posts: 30
Joined: Tue Mar 18, 2014 3:29 pm
Has thanked: 6 times
Been thanked: 0 time

Re: Need to edit a member in multiple PDS.

 

Re: Need to edit a member in multiple PDS.

Postby enrico-sorichetti » Tue Mar 25, 2014 4:22 pm

thank You for telling us :mrgreen:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Need to edit a member in multiple PDS.

Postby samurai » Tue Mar 25, 2014 7:29 pm

can someone let me know how to read all the Datasets stored in a PS and reading it one by one.
samurai
 
Posts: 30
Joined: Tue Mar 18, 2014 3:29 pm
Has thanked: 6 times
Been thanked: 0 time

Re: Need to edit a member in multiple PDS.

Postby Pedro » Tue Mar 25, 2014 8:58 pm

Use the ALLOC statement, EXECIO statement, and PARSE instruction.

For details about the first, see the TSO Command Reference. For details about the second two, see the TSO REXX Reference.
Pedro Vera
User avatar
Pedro
 
Posts: 569
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 39 times

Re: Need to edit a member in multiple PDS.

Postby NicC » Tue Mar 25, 2014 8:59 pm

And what is wrong with post that is currently 2 positions below yours? Did you search before posting?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Need to edit a member in multiple PDS.

Postby samurai » Tue Mar 25, 2014 9:23 pm

Hello pedro,

Thanks for the info, i can read all the data inside ps using ALLOC and EXECIO as below code:

"ALLOC F(IN) DS('MX9C.SAMPLE.JCL')SHR"
"EXECIO * DISKR IN(FINIS STEM INP."
"FREE F(IN)"
DO I = 1 TO INP.0
SAY INP.I
END
"ALLOC F(OUT) DS('MX9C.SAMPLE.JCL')SHR"
"EXECIO * DISKW OUT(FINIS STEM OUT."
"FREE F(OUT)"


Can you tell me how to edit the PDS inside a PS that i have mentioned in ALLOC

my ps contains 2 pds as shown below

MX9C.SAMPLEF.JCL ----> PS

MX9C.SAMPLE1.JCL
MX9C.SAMPLE2.JCL

the above is the PDS inside PS

and each pds has SAM1 as member name in which i need to apply c all xxxx to yyyy


FYI: i have written the below code to change in a member of a single PDS:

"ALLOC F(INFILE) SHR DS('MX9C.SAMPLE1.JCL(SAM1)')"
"EXECIO * DISKR INFILE (STEM RECD. FINIS"
HOW_MANY = RECD.0
DO C = 1 TO HOW_MANY
STRT = POS('NOTIFY=&SYSUID,',RECD.C)
SAY STRT ' STRT POS'
DO WHILE STRT > 0
SAY RECD.C
LN = LEFT(RECD.C,STRT-1)||'USER =RU99,NOTIFY=MX9C,'
RECD.C=LN
STRT=POS(IDCAMS,RECD.C)
SAY RECD.C
END
END C
"ALLOC F(OUTFILE) SHR DS('MX9C.SAMPLE1.JCL(SAM1)')"
"EXECIO * DISKW OUTFILE (STEM RECD. FINIS"
samurai
 
Posts: 30
Joined: Tue Mar 18, 2014 3:29 pm
Has thanked: 6 times
Been thanked: 0 time

Re: Need to edit a member in multiple PDS.

Postby Pedro » Wed Mar 26, 2014 12:38 am

the PDS inside a PS

To clarify... what you mean is that you have the names of a PDS. An important detail is 'name'. It is not possible to actually have a PDS inside a PS. (I contend it is not a PDS when it is in an unloaded form).
Pedro Vera
User avatar
Pedro
 
Posts: 569
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 39 times

Re: Need to edit a member in multiple PDS.

Postby Pedro » Wed Mar 26, 2014 12:56 am

Can you tell me how to edit the PDS


I think you have a good start, but instead of explicitly specifying a data set name:
"ALLOC F(INFILE) SHR DS('MX9C.SAMPLE1.JCL(SAM1)')"
you should use a program variable instead.
Pedro Vera

These users thanked the author Pedro for the post:
samurai (Wed Mar 26, 2014 11:08 am)
User avatar
Pedro
 
Posts: 569
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 39 times

Re: Need to edit a member in multiple PDS.

Postby samurai » Wed Mar 26, 2014 6:34 pm

i have completed this requirment successfully.

read the PDS from PS using EXECIO and processed each DS using the option SYSDSN("'"PDS_NAME"'").

Thanks!
samurai
 
Posts: 30
Joined: Tue Mar 18, 2014 3:29 pm
Has thanked: 6 times
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post