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
 

 

Efficient use of DISKRU in REXX !

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

Active User


Joined: 19 Mar 2009
Posts: 179
Location: Globe, India

PostPosted: Wed Sep 21, 2011 2:37 pm    Post subject: Efficient use of DISKRU in REXX !
Reply with quote

Code:
/* REXX */
"EXECIO 1 DISKRU ENTRIES 3 (STEM LIST."                       
LIST.1=55                                                     
"EXECIO * DISKW ENTRIES (STEM LIST. FINIS"                   
"EXECIO 1 DISKRU ENTRIES 4 (STEM LIST."                       
LIST.1=66                                                     
"EXECIO * DISKW ENTRIES (STEM LIST. FINIS"                   
"EXECIO 1 DISKRU ENTRIES 5 (STEM LIST."                       
LIST.1=77                                                     
"EXECIO * DISKW ENTRIES (STEM LIST. FINIS" 


above code updates file records one by one. I want to do the above task in minimum number of lines. Please suggest your ideas.
I have 2 options :
1. use loop
2. use "EXECIO N DISKRU ENTRIES 5(STEM LIST." & proceed --
where N stands for more than one record under Read with Update control.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Wed Sep 21, 2011 2:47 pm    Post subject: Reply to: Efficient use of DISKRU in REXX !
Reply with quote

Quote:
Efficient use of DISKRU in REXX !

thats a nice IT oxymoron

You can do it in a loop only if also the data to be written can be made dependent on a loop variable!
but You have not given any hint taht it would be so.

anyway UPDATING a PS dataset, even if the language used allows it is a bad, very bad practice
the process might not be repeatable in case of failures
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 179
Location: Globe, India

PostPosted: Wed Sep 21, 2011 3:17 pm    Post subject:
Reply with quote

i understand enrico, but still technically i want to know it.

this can work i think, take it in a sample example way :
Code:
DO X=4 to 6
"EXECIO 1 DISKRU ENTRIES X(STEM LIST."                       
LIST.1=X                                                     
"EXECIO * DISKW ENTRIES (STEM LIST. FINIS"
END
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Wed Sep 21, 2011 3:32 pm    Post subject: Reply to: Efficient use of DISKRU in REXX !
Reply with quote

it is alway a bad habit to issue a diskw without an explicit count

if the stem is not <clean> You might get unpleasant results
( a couple of flamig discussion on the subject in the forums )
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: Wed Sep 21, 2011 5:58 pm    Post subject: Reply to: Efficient use of DISKRU in REXX !
Reply with quote

rohanthengal, your approach seems OK to me. I guess that a loop would work if you had a bunch of updates to make. Don't forget that you can only update the last record read. I guess it's ultimately up to you to decide if this approach is better, or does it make more sense to just read the entire dataset in stem variables, update the stem variables you need to, and then just re-write the entire dataset.
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 179
Location: Globe, India

PostPosted: Thu Sep 22, 2011 8:42 am    Post subject:
Reply with quote

thanks a lot enrico n superk, for providing the info.
i got the major breakthrough for which i was looking for.Thanks once again.



Quote:
Don't forget that you can only update the last record read.
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: Thu Sep 22, 2011 7:33 pm    Post subject:
Reply with quote

Hello,

If this is an experiment or some one-time requirement, it may be ok to update the input file. If this is to be run "for real", you should copy the input to a new output rather than update in place for the sequential file.

During the promotion review, a well manage organization would not allow this to be promoted.

If someone is determined to overwrite the input, a copy needs to be made before possibly destroying the original.
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 REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts REXX compiled via RXTCOMP sergeyken CLIST & REXX 7 Tue Feb 07, 2017 9:41 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm


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