Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 4648
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: 4648
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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Copying Panvalet members to PDS LOGESHWARAN K CA Products 4 Mon Mar 06, 2017 10:45 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us