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
 

 

How to update a line to the dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: How to update a line to the dataset
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

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Dec 23, 2008 7:38 pm    Post subject: Reply to: Update a Ds
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    Post subject:
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

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Dec 23, 2008 8:12 pm    Post subject: Reply to: Update a Ds
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

Senior Member


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

PostPosted: Tue Dec 23, 2008 10:21 pm    Post subject: Reply to: How to update a line to the dataset
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    Post subject:
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: 2360
Location: Israel

PostPosted: Wed Dec 24, 2008 1:13 pm    Post subject:
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    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 Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts LISTCAT on a dataset with symbolic pa... shreya19 JCL & VSAM 5 Fri Apr 07, 2017 5:43 pm


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