View previous topic :: View next topic
|
Author |
Message |
murugan_mf
Active User
Joined: 31 Jan 2008 Posts: 148 Location: Chennai, India
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Code: |
...
"EXECIO 1 DISKRU MYINDD 2"
IF RC = 0 THEN
DO
PULL .
PUSH "XXX"
"EXECIO 1 DISKW MYINDD (FINIS"
END
...
|
|
|
Back to top |
|
|
murugan_mf
Active User
Joined: 31 Jan 2008 Posts: 148 Location: Chennai, India
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Keep in mind that REXX only uses QSAM for file processing. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
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 |
|
|
murugan_mf
Active User
Joined: 31 Jan 2008 Posts: 148 Location: Chennai, India
|
|
|
|
Pedro,
Can you please give me the EXECIO statement for writing and replacing a member. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
The EXECIO command is well documented in the fine manual.
O. |
|
Back to top |
|
|
|