View previous topic :: View next topic |
Author |
Message |
POLSKICASHCOW Beginner
Joined: 24 Jan 2004 Posts: 6 Topics: 4
|
Posted: Sat Jan 24, 2004 10:14 am Post subject: Character string replacement using REXX |
|
|
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 |
|
|
shiv_swami Beginner
Joined: 29 Nov 2003 Posts: 68 Topics: 14
|
Posted: Sat Jan 24, 2004 10:43 am Post subject: |
|
|
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 |
|
|
POLSKICASHCOW Beginner
Joined: 24 Jan 2004 Posts: 6 Topics: 4
|
Posted: Sun Jan 25, 2004 6:08 pm Post subject: |
|
|
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 |
|
|
superk Advanced
Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Sun Jan 25, 2004 7:21 pm Post subject: |
|
|
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 |
|
|
sriramla Beginner
Joined: 22 Feb 2003 Posts: 74 Topics: 1
|
Posted: Wed Jan 28, 2004 5:03 am Post subject: |
|
|
Code: | ADDRESS ISREDIT
" C ALL '?YR?' '2004'"
"SAVE"
"END" |
Run this on dataset(s) either online / batch. |
|
Back to top |
|
|
|
|