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
 

 

Unable to update PS using following REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
sshakya2

New User


Joined: 23 Dec 2010
Posts: 17
Location: Mumbai, India

PostPosted: Mon Jun 25, 2012 2:41 pm    Post subject: Unable to update PS using following REXX
Reply with quote

Hi,
I am a newbie to REXX, trying to update 8th Row of a flat file using following REXX.


"ALLOC DA('MY.DDNAME.FILE') F(UPDATEDD) MOD"
"EXECIO 1 DISKRU UPDATEDD 2 (LIFO"
PULL 8
PUSH '// SET PACKN='INPUTVAR
"EXECIO 1 DISKW UPDATEDD (FINIS"
"FREE F(UPDATEDD)"

What is wrong with this piece of code. I am unable to findout any error. It is running without any errors but not updating my flat file. Please help !
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Mon Jun 25, 2012 3:56 pm    Post subject:
Reply with quote

Try this

Code:
"ALLOC DA('MY.DDNAME.FILE') F(UPDATEDD) OLD"
"EXECIO 8 DISKRU UPDATEDD(LIFO"
PULL LINE
PUSH '// SET PACKN='INPUTVAR
"EXECIO 1 DISKW UPDATEDD (FINIS"
"FREE F(UPDATEDD)"
Back to top
View user's profile Send private message
sshakya2

New User


Joined: 23 Dec 2010
Posts: 17
Location: Mumbai, India

PostPosted: Mon Jun 25, 2012 4:15 pm    Post subject: Reply to: Unable to update PS using following REXX
Reply with quote

Thanks !!! wat was my mistake ??
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Mon Jun 25, 2012 4:21 pm    Post subject:
Reply with quote

You should be able to tell me that icon_wink.gif
Back to top
View user's profile Send private message
sshakya2

New User


Joined: 23 Dec 2010
Posts: 17
Location: Mumbai, India

PostPosted: Mon Jun 25, 2012 4:27 pm    Post subject: Gotcha !!!
Reply with quote

Looks like i was trying to change the colour of a wall and was pointing the brush onto the Table icon_smile.gif icon_smile.gif
Back to top
View user's profile Send private message
sshakya2

New User


Joined: 23 Dec 2010
Posts: 17
Location: Mumbai, India

PostPosted: Mon Jul 02, 2012 10:51 am    Post subject:
Reply with quote

Achieved it by reading it into a STEM and changing the particular occurances of the Array.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Mon Jul 02, 2012 2:27 pm    Post subject:
Reply with quote

You should note carefully the differences in the 2nd and 3rd lines between your code and Pandor-Box's code
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jul 02, 2012 6:41 pm    Post subject:
Reply with quote

Hello,

You should also reconsider your approach. . .

Well organized places do not let a process update the input sequential file.
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 Jul 03, 2012 1:43 am    Post subject: Reply to: Unable to update PS using following REXX
Reply with quote

If all you wanted to do was update the 8th record of a dataset, this is all the code that you would've needed:

Code:

/* REXX */
"EXECIO 1 DISKRU updatedd 8"                     
Parse Pull inrec                                 
inrec = Strip(inrec)" ** Updated **"             
Push inrec                                       
"EXECIO 1 DISKW updatedd (FINIS"                 
Exit 0


Results:

Before:

Code:

This is test record 1 of 9.
This is test record 2 of 9.
This is test record 3 of 9.
This is test record 4 of 9.
This is test record 5 of 9.
This is test record 6 of 9.
This is test record 7 of 9.
This is test record 8 of 9.
This is test record 9 of 9.


After:

Code:

This is test record 1 of 9.                             
This is test record 2 of 9.                             
This is test record 3 of 9.                             
This is test record 4 of 9.                             
This is test record 5 of 9.                             
This is test record 6 of 9.                             
This is test record 7 of 9.                             
This is test record 8 of 9. ** Updated **               
This is test record 9 of 9.                             
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 What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm


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