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: 2025
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 -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
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
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm


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