Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
copying to new data set with specific word changed

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: copying to new data set with specific word changed
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

Moderator Team Head


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

PostPosted: Tue Aug 15, 2006 5:45 pm    Post subject: Re: copying to new data set with specific word changed
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

Moderator Team Head


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

PostPosted: Tue Aug 15, 2006 5:55 pm    Post subject: Re: copying to new data set with specific word changed
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    Post subject:
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    Post subject: Re: copying to new data set with specific word changed
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us