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

How to update a line to the dataset


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

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Tue Dec 23, 2008 7:20 pm
Reply with quote

Hi All,

Can anyone explain how to update a line to the dataset.
Here in the below code I am trying to update the second line by 'XXX'. Here it is writing XXX but not updating.

Code:
"ALLOC FI(MYINDD) DA('INPUT.DATA.SET') OLD REUSE"
"EXECIO * DISKRU MYINDD (FINIS STEM NEWVA."                           
NEWVA.2='XXX'                                                       
PUSH NEWVA.2                                                         
"EXECIO * DISKW MYINDD   (FINIS"
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 Dec 23, 2008 7:38 pm
Reply with quote

Code:

...
"EXECIO 1 DISKRU MYINDD 2"
IF RC = 0 THEN
  DO
    PULL .
    PUSH "XXX"
    "EXECIO 1 DISKW MYINDD (FINIS"
  END
...

Back to top
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Tue Dec 23, 2008 8:03 pm
Reply with quote

Thanks for your answer kevin.

Here I need to insert a new line if i found a first particular occurence( For example searching for string "INCLUDE") .

How to go over this
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 Dec 23, 2008 8:12 pm
Reply with quote

Keep in mind that REXX only uses QSAM for file processing.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Tue Dec 23, 2008 10:21 pm
Reply with quote

1. Read the whole thing into a stem using EXECIO

2. Insert your new line. Likely, you will have to copy to a different stem.

3. Use EXECIO to write the new stem and replace the old member.
Back to top
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Wed Dec 24, 2008 1:04 pm
Reply with quote

Pedro,
Can you please give me the EXECIO statement for writing and replacing a member.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Dec 24, 2008 1:13 pm
Reply with quote

The EXECIO command is well documented in the fine manual.

O.
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top