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 

Character string replacement using REXX

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


Joined: 24 Jan 2004
Posts: 6
Topics: 4

PostPosted: Sat Jan 24, 2004 10:14 am    Post subject: Character string replacement using REXX Reply with quote

Embarassed

I am trying to change a character string in a line of JCL.
IE.

OPEN DATASET test1(mem1)

Change '?yr?' to '2004' (regardless of location)

Write to DATASET test2(newmem)

Is there a quick and dirty war to do this without a great deal of code.
Much appreciated.
Back to top
View user's profile Send private message
shiv_swami
Beginner


Joined: 29 Nov 2003
Posts: 68
Topics: 14

PostPosted: Sat Jan 24, 2004 10:43 am    Post subject: Reply with quote

Hi POLSKICASHCOW,

You can use File Aid for this requirement.
Use F.3.6 Batch or Online
Go to Unformatted Selection Criteria for conditions you want.
_________________
Regards,
Shivprakash
Back to top
View user's profile Send private message Yahoo Messenger
POLSKICASHCOW
Beginner


Joined: 24 Jan 2004
Posts: 6
Topics: 4

PostPosted: Sun Jan 25, 2004 6:08 pm    Post subject: Reply with quote

I need to code it in REXX as I am converting from VM to MVS as that box will no l9onger be supported. Please assists. Thanks muchly.
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Sun Jan 25, 2004 7:21 pm    Post subject: Reply with quote

I'd go with a straight PARSE command:

Code:

"EXECIO 1 DISKR jclin"
If rc = 0 Then
  Do
    Pull the_rec
    /* The variable 'rgt' will only contain data when
        the PARSE is successful */
    Parse Var the_rec lft '?yr?' rgt
    If Length(rgt) > 0 Then the_rec = lft||'2004'||rgt
    Push the_rec
    "EXECIO 1 DISKW jclout"
  End
Back to top
View user's profile Send private message
sriramla
Beginner


Joined: 22 Feb 2003
Posts: 74
Topics: 1

PostPosted: Wed Jan 28, 2004 5:03 am    Post subject: Reply with quote

Code:
ADDRESS ISREDIT
" C ALL '?YR?' '2004'"
"SAVE"
"END"

Run this on dataset(s) either online / batch.
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