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 3270 Data stream error Benchwarmer CICS 4 Tue Apr 17, 2018 12:06 am
No new posts How to list data set names with diffe... murali.andaluri CLIST & REXX 8 Thu Apr 12, 2018 11:33 pm
No new posts converting a mainframe file with ASA ... Lynne Schuler All Other Mainframe Topics 5 Wed Apr 04, 2018 9:44 am
No new posts SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am
No new posts Invalid XML character while producing... nikhil.bhole IBM Tools 4 Tue Mar 20, 2018 1:24 am

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