Previous Topic: $GREG2JUL()Next Topic: $JUL2GREG()


$ISPFSTAT()

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.

Syntax

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

ver

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.

crdate

Creation date for this member. The format is mm/dd/yy.

chdate

Date of last modification. The format is mm/dd/yy.

chtime

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.

size

Current size, in lines (logical records) of the member. A whole number from 0 through 65535.

init

Size, in lines (logical records), of the member when it was created. This is a whole number in the range of 0 through 65535.

mod

Number of times this member has been modified. A whole number from 0 to 65535.

user

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.

ENCODE

Prepares a 30-byte ISPF-compatible data field, using the provided data.

DECODE

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.

data

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:

0 - 1

Version, binary

1 - 1

Modification level, binary

2 - 1

Reserved

3 - 1

For ISPF 3.3 and later, the seconds portion of the modification time. Unsigned packed decimal.

4 - 4

Creation date: 00yydddF. Julian, signed packed decimal.

8 - 4

Last changed date: 00yydddF. Julian, signed packed decimal.

12 - 1

The hours portion of the modification time. Unsigned packed decimal.

13 - 1

The minutes portion of the modification time. Unsigned packed decimal.

14 - 2

The current number of records (lines) in the member. Unsigned binary.

16 - 2

The number of records (lines) in the member when created. Unsigned binary.

18 - 2

The number of times the member has been modified. Unsigned binary.

20 - 7

First seven characters of the user ID responsible for the last alteration of the member.

27 - 3

Reserved. Three character blanks (X'40').

Return Codes

101 - 109

ARG n MISSING OR INVALID

121

DATA LENGTH NOT 28

122

CREATE DATE NOT PACKED DECIMAL

123

CREATE DATE NOT VALID JULIAN

124

CHANGE DATE NOT PACKED DECIMAL

125

CHANGE DATE NOT VALID JULIAN

126

CHANGE TIME NOT PACKED DECIMAL

127

BAD VV.MM

128

BAD CREATE DATE

129

BAD CHANGE DATE

130

BAD CHANGE TIME

131

BAD SIZE

132

BAD INIT SIZE

133

BAD MODIFICATION LEVEL

134

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