Well this is interesting, in that it sounds like I'm not the only one who's not 
100% clear on what the rules are for "touch". Doc doesn't say much either 
(typical *ix doc).

-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
Bernd Oppolzer
Sent: Friday, August 2, 2024 6:31 PM
To: [email protected]
Subject: Re: How to "touch" mainframe files

Phil asked:

This makes me realize that I don't know what "touch" actually does. I mean, I 
know the effect, but what does it have to do to make that happen?

IMO:

The arcane Unix systems probably had only one timestamp per file, no difference 
for read/write, and files are simply chains of bytes, so I believe that what 
touch does is open the file for append, then append nothing and then close the 
file.
This way the date (of last write) should be set to the current date (or 
timestamp).

A simple open for read should IMO not change the date of a file.

But that's some speculation on my part ...

HTH, kind regards

Bernd


Am 02.08.2024 um 22:30 schrieb Phil Smith III:
> Billy Ashton asked how to do the equivalent of a USS "touch" on a z/OS data 
> set.
>
> I'm wondering if there's something like the C "DD:ddname" filename 
> specification hack that could be used. I know this would seem odd: run a 
> batch job that uses BPXwhatever to run USS "touch", but if it's possible...?
>
> This makes me realize that I don't know what "touch" actually does. I mean, I 
> know the effect, but what does it have to do to make that happen? If it's 
> some filesystem function, a minimal C program might be able to use the 
> "DD:ddname" hack and that function. Googling suggests that it just opens the 
> file and that that's sufficient to update it, but there has to be more, since 
> it can optionally update just the last access time, without updating the last 
> changed time.
>
> In fact, the more I think about this, I now wonder what "last referenced" 
> even means; I assume it's time of last access, not change?
>
> Billy wrote, in part:
>> We don't want to do things like allocate, open, and print one record, 
>> as some of these files are huge (25-50GB).
> Would you need to print a record to update "last referenced"? Shouldn't 
> reading a record suffice? Do you even need to do that? Why does the size of 
> the file matter here?
>
> I'm sure these are dumb questions but my in-depth filesystem knowledge is for 
> other OSes, so I'm just knowledgeable enough to be curious...
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions, send 
> email to [email protected] with the message: INFO IBM-MAIN

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

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

Reply via email to