Posted by Robert G Laurin on January 30, 2012 at 12:10:16:
Just discovered (the hard way) that PSTAT does not return expected values in Comet32.
I use the PSTAT in a routine to log changes made by operators. This routine is basically in every maintenance program.
Since Comet does not provide any easy mean to track changes, I rely on the PSTAT to know what was done.
Logic is:
Extract (LUN, Fmt) Key=WhateverKey$
Gosub AuditREAD
..
Allow user to edit fields
..
Write (LUN,FMT) Key=WhateverKey$
Gosub AuditWRITE
Where AuditREAD and AuditWRITE sets ActionFlag$ as 'R' or 'W' and calls AuditFile
AuditFile does:
Input (#,Buffer) ! Save the Last I/O Content
Pstat$ = Sub(PSTAT(PARTITION$),1,34) ! Get 34 bytes of PSTAT (Current Program, Current File, Directory, Terminals - LUN is always ZERO-ZERO)
..
then grab the Date$ and Time$
..
Write (AuditFile,Buffer) KEY=Date$+Time$+ActionFlag$+Pstat$+OperatorID$
Using Comet16, this worked for the last 15 years.
Using Comet32 (compiled 16) I get:
Program(8)+00+WrongFile(8)+BlankExt(3)+BlankMissingDirectory(3)+LastFunc(2)+Garbage(2)+Term$(3)+BlankMissingITerm$(3)
My Audit routines really need the FileName and Directory. The key is not supplied by Comet, but as good practice, it is present in the data. The Audit routine does not know which file it is auditing nor where is the key and how long it is. This is why I use a timestamp and other info
Here's example of real keys:
Comet16:
01301214:26:37.29WCMM 00C1A-ST FST3F32T21T21RGL
Comet32:
01301214:27:43.25WCMM 00S2O-ST 3F. T21 RGL
This was tested using Comet32 2011.454
Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.