LS command shows wrong date for datasets

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
hroman
Posts: 27
Joined: Thu Aug 13, 2009 10:09 am

LS command shows wrong date for datasets

Post by hroman »

We are running Co:Z cozsftp version: 1.3.2 (5.0p1) 2009-07-14.

When we issue an LS -l command for z/OS datasets, the date shown is either off by one day or shows a 1969 date.

Examples:

cozsftp> ls -l //zeexotf.tfex.zetf500.arcout/*

-rw-rw-rw- 0 0 0 228086400 Dec 31 1969 //zeexotf.tfex.zetf500.arcout/G0025V00

cozsftp> ls -l //zeexotf.tfex.zetf500.arcout

PRDL05+ 2011/01/08 4 4140 4132 FB 1199 27577 PS ZEEXOTF.TFEX.ZETF500.ARCOUT.G0025V00

The ISPF 3.4 display of the dataset shows:

PRDL05+ 2011/01/08 4 4140 4132 FB PRDL05+
4140 99 4 3390 PS FB 1199 27577 2011/01/07 2011/01/07
CATALOG.SHAR05

As you can see, the dataset was created and referred on 2011/01/07 not on 2011/01/08.

Thanks,

Jerry Roman
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

There are two issues:

1) If you use this form:
cozsftp> ls -l //zeexotf.tfex.zetf500.arcout/*

Then OpenSSH sftp will display a Unix-formatted file list formatted by the client.
In this case, the date that you see (12/31/1969) is because this date in Unix format represents the "last updated" date/time, and there isn't really such a thing for MVS datasets. We don't return a date field for this, but OpenSSH treats a missing date as this funny date (0). We have had this question many times, but I'm not sure what we should do. Would it be better to return the "Last Referenced" date, at midnight for this? That might be more useful, but technical incorrect. Also, if the client formatted a date which was the current day, most sftp clients will display the time instead of the date, which would be "0:00" (z/OS doesn't keep creation or last-reference times).

If you use this form (supplying the name of a dataset "Level", which is treated as a directory, without a "*') -

cozsftp> ls -l //zeexotf.tfex.zetf500.arcout

You will get a long-formatted listing supplied by the z/OS server; so we can give you a z/OS style format. BTW: if you specify "-al", you will also get a header line.

2) The "one off" issue in the z/OS long-formatted listing turns out to be a bug. Its odd that no one ever noticed, but I found that we have a bug in our Julian date formatting routine, and that January dates are displayed off by 1. We will fix this in the next release. Thanks again for reporting this.
hroman
Posts: 27
Joined: Thu Aug 13, 2009 10:09 am

Post by hroman »

Thanks for the response.

Jerry Roman
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

No problem Jerry.

What is your (anyone's) opinion regarding using the "Last Referred Date" (at midnight) for the Unix "last update timestamp" that is returned to the SFTP client (for its formatted version) ?
hroman
Posts: 27
Joined: Thu Aug 13, 2009 10:09 am

Post by hroman »

Although it's technically not correct, it would be better than what we are seeing now. I think that systems folks would be able to easily relate it to the 'last reference date'.

Jerry
Post Reply