This function converts an IBM packed-decimal number into a REXX-format whole number.
number = P2D(pdec)
Parameters
A whole number.
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.
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 */
|
Copyright © 2014 CA Technologies.
All rights reserved.
|
|