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

Efficient use of DISKRU in REXX !


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

Active User


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

PostPosted: Wed Sep 21, 2011 2:37 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 21, 2011 2:47 pm
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: 206
Location: Globe, India

PostPosted: Wed Sep 21, 2011 3:17 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 21, 2011 3:32 pm
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

Global Moderator


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

PostPosted: Wed Sep 21, 2011 5:58 pm
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: 206
Location: Globe, India

PostPosted: Thu Sep 22, 2011 8:42 am
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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Sep 22, 2011 7:33 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top