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 

Changing contents using EDITALL

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


Joined: 22 May 2006
Posts: 4
Topics: 2

PostPosted: Mon Feb 26, 2007 11:06 am    Post subject: Changing contents using EDITALL Reply with quote

My requirement:

I need to change all members in a PDS which has RLSE1='CHGMAN.CARD.PGMLIB' to something like RLSE1='WXX048.COPE59.PGMLIB'

The problem is that the '59' (in 'WXX048.COPE59.PGMLIB') can be any 2 character value depending on an input which is captured in a temporary variable (say &TQ). I tried to use EDITALL in Fileaid but I'm not aware of how to use a variable to replace a specific set of characters.

Please suggest how I can use EDITALL to achieve this. If not possible, please suggest an alternative using either SORT or CLIST or REXX code.
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: Mon Feb 26, 2007 11:44 am    Post subject: Reply with quote

sbarai,

The EDITALL command syntax is of the following format


Code:

$$DD01 COPY EDITALL=(01,00,C'your search string',
                     C'your replace string')     


So you can split this card into 2 80 byte card datasets

card1 dataset
Code:

$$DD01 COPY EDITALL=(01,00,C'your search string',


card2 dataset

Code:

                     C'your replace string')   


So when you are running the JCL you can simply concatenate these 2 card datasets and the pgm will treat as 1 single card like below

Code:

//STEP0100 EXEC PGM=FILEAID           
//SYSPRINT DD SYSOUT=*               
//DD01     DD *                       
BLAH BLAH BLAH                       
RLSE1='CHGMAN.CARD.PGMLIB'           
BLAH BLAH BLAH                       
//DD01O    DD SYSOUT=*               
//SYSIN    DD *                       
$$DD01 COPY EDITALL=(01,00,C'your search string',
                     C'your replace string')     


for you the string to be searched and replaced both contain quotes , so we need to embed them within double quotes

Code:

//SYSIN    DD *                                         
$$DD01 COPY EDITALL=(01,00,C"RLSE1='CHGMAN.CARD.PGMLIB'",
                     C"RLSE1='WXX048.COPE59.PGMLIB'")   


So create the replace card dynamically every time in the following format and concatenate it to the fixed card.

ex:
dynamic card

Code:

        C"RLSE1='WXX048.COPE59.PGMLIB'") 



Code:

//STEP0100 EXEC PGM=FILEAID                             
//SYSPRINT DD SYSOUT=*                                   
//DD01     DD *                                         
BLAH BLAH BLAH                                           
RLSE1='CHGMAN.CARD.PGMLIB'                               
BLAH BLAH BLAH                                           
//DD01O    DD SYSOUT=*                                   
//SYSIN    DD *                                         
$$DD01 COPY EDITALL=(01,00,C"RLSE1='CHGMAN.CARD.PGMLIB'",
//         DD DSN=dynamic card,DISP=SHR                           
/*


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
sbarai
Beginner


Joined: 22 May 2006
Posts: 4
Topics: 2

PostPosted: Tue Feb 27, 2007 7:11 am    Post subject: problem not yet solved Reply with quote

Kolosu,

I tried with your code but my problem is that I need to have a variable value in the replace string in the 2nd card.

Even if I don't concatenate and just want the value in &TQ as the replace string, I need to write C&TQ) in the 2nd card dataset; for which I get an error

$$DD01 UPDATE MEMBERS=ALL, 00115006
EDITALL=(01,00,C'RLSE1=CHGMAN.CARD.PGMLIBB', 00116006
C&TQ)
INVALID FORMAT FOR EDITALL, CHECK DATA STARTING IN COLUMN 09
.....SKIPPING TO NEXT $$DD CARD RC=4

After the C, it always expects a ' which if I write as C'&TQ', it will take it as a literal &TQ.

So please suggest a solution.
Back to top
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Tue Feb 27, 2007 8:48 am    Post subject: Reply with quote

You must build the dynamic card once you know what your new value will be. Then the EDITALL step can read the card.
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
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: Tue Feb 27, 2007 9:03 am    Post subject: Reply with quote

sbaraj,

You forgot the basic rules of symbolics in JCL. Symbolics are NOT resolved in the Sysin control cards. What I mentioned is to create the 2 control card from the pgm which generates the symbol itself.

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


Joined: 22 May 2006
Posts: 4
Topics: 2

PostPosted: Tue Feb 27, 2007 1:32 pm    Post subject: Reply with quote

Hi Kolusu,

Thanks for reminding me about that. I missed that out completely.
In my case the variable is being input by an user from a CLIST panel. So actually no program is involved. Would there be any other way out other than writing a program to concatenate the variable and the string and writing it to a dataset?

Thanks for your valuable suggestions.
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: Tue Feb 27, 2007 1:57 pm    Post subject: Reply with quote

sbarai wrote:
Hi Kolusu,

In my case the variable is being input by an user from a CLIST panel. So actually no program is involved. Would there be any other way out other than writing a program to concatenate the variable and the string and writing it to a dataset?

Thanks for your valuable suggestions.



hmm why can't the Clist create the dynamic control card once it accepts the input from the user?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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