IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

copying to new data set with specific word changed


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Pollyannaish

New User


Joined: 09 Jul 2005
Posts: 31
Location: Pune, India

PostPosted: Tue Aug 15, 2006 4:28 pm
Reply with quote

Hi guys
I am trying to copy a PDS member to another member using rexx..( Very poor in rexx)

what i need to do is to chnage a specific word into another like "new" to "OLD"

I tried writting this rexx but it does not work..
Please help me..

Code:

"ALLOC DA('XX.XX.REXX(TESTEXP)') F(DATAIN) SHR REUSE"
"ALLOC DA('XX.XX.REXX(W1GCS7EF)') F(DATAOUT) MOD"
"EXECIO * DISKR DATAIN (STEM LINE. FINIS"
DO I = 1 TO LINE.0
   SAY LINE.1
   TRANSLATE(LINE.I,'NEW','OLD')
      "EXECIO 1 DISKW DATAOUT"
      SAY 'LINE.I'
END
"EXECIO 0 DISKW DATAOUT (FINIS"
EXIT 0


Can suomeone please explain me the fault and help me in writting the new one..
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Aug 15, 2006 5:45 pm
Reply with quote

You're missing an assignment, and you're using the 'TRANSLATE' function incorrectly (It's TRANSLATE variable,new-value,old-value). You also neglected to PUSH the updated variable into the stack:

Code:

DO I = 1 TO LINE.0
   SAY LINE.1
   LINE.I = TRANSLATE(LINE.I,'OLD','NEW') <== change this
   PUSH LINE.I                            <== add this
   "EXECIO 1 DISKW DATAOUT"
   SAY 'LINE.I'
END
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Aug 15, 2006 5:55 pm
Reply with quote

Also, on an unrelated issue, last I knew of, DISP=MOD processing is not valid for a PDS member:

Code:

"ALLOC DA('XX.XX.REXX(W1GCS7EF)') F(DATAOUT) MOD"


If I recall, PDS members are allocated as either SHR or OLD only.
Back to top
View user's profile Send private message
Pollyannaish

New User


Joined: 09 Jul 2005
Posts: 31
Location: Pune, India

PostPosted: Wed Aug 16, 2006 8:03 am
Reply with quote

Thanks Superk

But now the trouble is translate chnages the string unsing characters but i want to change the words only.

Do we have specific command or function using which we can change
specific word to another..??? not the character..

Thanks
Prem
Back to top
View user's profile Send private message
Sathishk

New User


Joined: 16 Feb 2006
Posts: 8

PostPosted: Wed Aug 16, 2006 12:07 pm
Reply with quote

Hi,

You can use an edit macro with a CHANGE command in it.


Sathish
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top