This function decodes ISPF statistics that are stored in the user-data field of PDS member entries. It also encodes information into ISPF-compatible format.
Form 1:
ver crdate chdate chtime size init mod user = $ISPFSTAT(DECODE,data)
Form 2:
$ISPFSTAT(ENCODE,ver,crdate,chdate,chtime,size,init,mod,user)
Parameters
Version and modification level, which is specified as vv.mm. vv and mm are whole numbers from 00 to 99. The period is a separator and not a decimal point. Encoding the value 1.5 and then decoding it yields 01.05 as the result.
Creation date for this member. The format is mm/dd/yy.
Date of last modification. The format is mm/dd/yy.
Time of last modification. The format is hh:mm, or hh:mm:ss where hh ranges from 0 to 24, mm ranges from 0 to 59, and ss ranges from 0 to 59. hh, mm, and ss are whole numbers.
Current size, in lines (logical records) of the member. A whole number from 0 through 65535.
Size, in lines (logical records), of the member when it was created. This is a whole number in the range of 0 through 65535.
Number of times this member has been modified. A whole number from 0 to 65535.
User ID of the user who last updated (or created) this member. This is a seven character field (the eighth character, if any, is truncated), right-padded with blanks.
Prepares a 30-byte ISPF-compatible data field, using the provided data.
Extracts data from a 30-byte ISPF compatible data field. The resulting fields are returned as the result of the function, in blank-delimited form.
30-byte binary string, representing ISPF-compatible member statistics. The format is as follows, where the first piece of information represents the offset, the second represents the length, and the third describes the data:
Version, binary
Modification level, binary
Reserved
For ISPF 3.3 and later, the seconds portion of the modification time. Unsigned packed decimal.
Creation date: 00yydddF. Julian, signed packed decimal.
Last changed date: 00yydddF. Julian, signed packed decimal.
The hours portion of the modification time. Unsigned packed decimal.
The minutes portion of the modification time. Unsigned packed decimal.
The current number of records (lines) in the member. Unsigned binary.
The number of records (lines) in the member when created. Unsigned binary.
The number of times the member has been modified. Unsigned binary.
First seven characters of the user ID responsible for the last alteration of the member.
Reserved. Three character blanks (X'40').
ARG n MISSING OR INVALID
DATA LENGTH NOT 28
CREATE DATE NOT PACKED DECIMAL
CREATE DATE NOT VALID JULIAN
CHANGE DATE NOT PACKED DECIMAL
CHANGE DATE NOT VALID JULIAN
CHANGE TIME NOT PACKED DECIMAL
BAD VV.MM
BAD CREATE DATE
BAD CHANGE DATE
BAD CHANGE TIME
BAD SIZE
BAD INIT SIZE
BAD MODIFICATION LEVEL
BAD USERID
Example
/* Locate member, display ISPF attributes */ parse upper arg dsn member x = alloc(dsn,'shr') dcb = sam('obtain',,x,'pdsin') if rc ^= 0 then return 'obtain returns' rc '-' dcb x = sam('open',dcb) if rc ^= 0 then return 'open returns' rc '-' x data = sam('bldl',dcb,member) if rc ^= 0 then return 'bldl returns' rc '-' data flags = x2b(c2x(substr(data,14,1))) length = x2d(b2x(substr(flags,4,5)||'0')) if length < 28 then return 'ISPF statistics not available' if substr(flags,1,1) == '1' then type = 'ALIAS' else type = 'MEMBER' data = substr(data,15,30) x = $ispfstat('decode',data) parse var x vvmm create chdate chtime size init mod user
Copyright © 2014 CA Technologies.
All rights reserved.
|
|