EXECIO DISKW Question

2011-06-01 Thread Sergio Lima

Hello List,
 
We want write a REXX EXEC , that do a Update in place.
Another words, I need, read the record 1 from the file, and then rewrite the 
same record.
Is possible?
 
Thanks,
 
Sergio

Re: EXECIO DISKW Question

2011-06-01 Thread Chip Davis

Yes, but be careful.  Try:

  EXECIO 1 DISKRU ...

-Chip-

On 6/1/11 14:49 Sergio Lima said:

Hello List,
 
We want write a REXX EXEC , that do a Update in place.
Another words, I need, read the record 1 from the file, and then rewrite 
the same record.

Is possible?
 
Thanks,
 
Sergio


Re: EXECIO DISKW Question

2011-06-01 Thread Alan Altmark
On Wednesday, 06/01/2011 at 10:50 EDT, Sergio Lima 
sergiovm...@hotmail.com wrote:

 We want write a REXX EXEC , that do a Update in place.
 Another words, I need, read the record 1 from the file, and then rewrite 
the 
 same record.
 Is possible?

Yes.  There are a few programming considerations:
1.  If the file is RECFM F, you can change any record you want.
2.  If the file is RECFM V, you can change any record you want.
3.  If you change the LRECL of a record in a RECFM V file, that record 
will become the last record in the file.
4.  If other virtual machines have the disk accessed while you're doing 
this, then you can use filemode number 6 to cause the records to be 
physically rewritten to the same disk location.
5.  Update-in-place using fm6 exposes the file to corruption if the system 
or CMS dies in the middle of a write.

For more information, please read these (sub)sections of Ch. 9 (CMS File 
System) of the CMS Application Development Guide for Assembler
- Replacing Records
- EDF Data Integrity
- Extending the file

Alan Altmark

z/VM and Linux on System z Consultant
IBM System Lab Services and Training 
ibm.com/systems/services/labservices 
office: 607.429.3323
mobile; 607.321.7556
alan_altm...@us.ibm.com
IBM Endicott


Re: EXECIO DISKW Question

2011-06-01 Thread Mike Walter
Read up also about FILEMODE 6.

And be sure that the file being updated has RECFM F (fixed record format), 
not RECFM V (variable). 

Once you are satisfied that you have it working, run some performance 
tests comparing: 
- updating that file 
vs 
- reading in the whole file, replacing just that record, and re-writing 
the whole file using CMS Pipelines.  You may be surprised (depending on 
the file size, your disk subsystem, etc.).

Mike Walter
Aon Corporation
The opinions expressed herein are mine alone, not my employer's.



Chip Davis c...@aresti.com 

Sent by: The IBM z/VM Operating System IBMVM@LISTSERV.UARK.EDU
06/01/2011 10:28 AM
Please respond to
The IBM z/VM Operating System IBMVM@LISTSERV.UARK.EDU



To
IBMVM@LISTSERV.UARK.EDU
cc

Subject
Re: EXECIO DISKW Question






Yes, but be careful.  Try:

   EXECIO 1 DISKRU ...

-Chip-

On 6/1/11 14:49 Sergio Lima said:
 Hello List,
 
 We want write a REXX EXEC , that do a Update in place.
 Another words, I need, read the record 1 from the file, and then rewrite 

 the same record.
 Is possible?
 
 Thanks,
 
 Sergio






The information contained in this e-mail and any accompanying documents may 
contain information that is confidential or otherwise protected from 
disclosure. If you are not the intended recipient of this message, or if this 
message has been addressed to you in error, please immediately alert the sender 
by reply e-mail and then delete this message, including any attachments. Any 
dissemination, distribution or other use of the contents of this message by 
anyone other than the intended recipient is strictly prohibited. All messages 
sent to and from this e-mail address may be monitored as permitted by 
applicable law and regulations to ensure compliance with our internal policies 
and to protect our business. E-mails are not secure and cannot be guaranteed to 
be error free as they can be intercepted, amended, lost or destroyed, or 
contain viruses. You are deemed to have accepted these risks if you communicate 
with us by e-mail. 


Re: EXECIO DISKW Question

2011-06-01 Thread David Boyes
  We want write a REXX EXEC , that do a Update in place.
  Another words, I need, read the record 1 from the file, and then
 rewrite
 the
  same record.
  Is possible?

In addition to reading the manuals that Alan suggested, you should look for the 
RXFILEIO package on the VMWorkshop tapes. It provides CMS filesystem I/O 
interfaces that are much more natural REXX function interfaces to the CMS file 
I/O macros. You probably could also use the CMS common I/O routines, but 
they're a lot harder to understand and use.