Previous Topic: OSCMD()Next Topic: PAUSE()


P2D()

This function converts an IBM packed-decimal number into a REXX-format whole number.

Syntax

number = P2D(pdec)

Parameters

number

A whole number.

pdec

A packed-decimal number. Each byte contains two decimal digits, except the right-most byte, which can contain a sign digit (hexadecimal F for positive, B for negative) in the right half of the byte.

Return Codes

101

ARG 1 MISSING OR INVALID

Example

/*  Unpack a julian date from ISPF statistics format */

parse arg value                          /* date: 00 yy dd dF */
julian = p2d(value)                      /* REXX number       */
final = right(insert('.',julian,length(julian)-3),6,'0')
                                         /* yy.ddd            */