On Tue, 16 Aug 2016 12:27:29 -0700, Tom Brennan wrote:

>I think you're right Skip.  My impression from some old coding attempts,
>is that Unix by default lacks the kind of integrity we're used to seeing
>on MVS.  Clists and Rexx's die if they get an error but a shell script
>just chugs along as if nothing happened.
>
Ummm... no.  A syntax error is immediately fatal to both shell script and
Rexx alike.  Both provide means to trap the error and recover.  In both
cases an error in a host (system) command sets a status (RC) value
which the programmer can test and process as proper.

>I remember coding a multi-task
>program in C and if I wrote to stdout (the screen) from 2 tasks at about
>the same time, one message might end up in the middle of another.
>
Does C under z/OS behave differently from C under UNIX?  From
experiments under MVS decades ago, I recall:

o If I write to spool, same job, same DDNAME, different tasks, different
  DCBs, JES interleaves the lines, JES interleaves the lines, much as
  UNIX would.

o If I similarly write to a Classic data set, I'm likely to get I/O errors.
  The tasks are maintaining their own inconsistent notions of the
  dynamic value of DS1LSTAR (?).  They are apt to overwrite each
  other's blocks.

  The same thing happens with different jobs if both use DISP=SHR.

DISP=SHR prevents freeing an extent while there's an orphaned DEB,
the most obvious integrity hazard.  UNIX keeps control blocks with
similar function in the kernel space, thereby avoiding the hazard of
directory corruption.

>This
>is strange stuff that I would have thought would be taken care with an
>enqueue under the covers.
> 
UNIX protects directory integrity even as z/OS protects VTOC integrity.

Some systems provide support for any number of concurrent readers
but at most one concurrent writer.  z/OS doesn't really support this
(DISP=SHR?)  VM tries harder with its link modes, but doesn't quite
succeed.

>My guess is it's just a different mentality.  If you want to lock your
>open file in Unix, you have to lock it yourself, otherwise a simpler
>(and quicker) method is used where anybody can access and even write to
>the same file at the same time as someone else.
> 
In both cases, UNIX and z/OS, it's elective.  If you don't ask for
EXClusive access you don't get it.  The habit of not writing with
DISP=SHR is so ingrained that programmers don't realize there's
a risky alternative.  But the OS doesn't prohibit it.

>I could be wrong with a lot of this... it's just my impression as a
>part-time Unix user/programmer.
>
>Jesse 1 Robinson wrote:
>> My first reaction was to respond acerbically that file integrity never quite 
>> made the UNIX afterthought list, but that would have been unkind, so I 
>> won't. But if it works, it might be worth a try. It's not customer data 
>> anyway...
>
And for logging you can rely on concurrent write access with O_APPEND.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to