This general macro provides three services:
- Conversion of a 2-byte binary number representing minutes since midnight
to a 5-byte EBCDIC representation of the time of day based on the 12-hour
clock format
- Conversion of a 5-byte EBCDIC representation of the time of day based on
the 12-hour clock format to a 2-byte binary number representing minutes since
midnight
- Conversion of a 4-byte EBCDIC representation of the time of day based on
the 24-hour clock format to a 2-byte binary number representing minutes since
midnight.
Format
- label
- A symbolic name can be assigned to the macro statement.
- MODE=BCDBIN
- Indicates that the conversion is from EBCDIC to binary.
- NUMBCD
- This parameter specifies whether the EBCDIC input is based on the 12-hour
or 24-hour clock.
- NO
- Indicates the 12-hour clock format.
- YES
- Indicates the 24-hour clock format.
NUMBCD is optional and is used only when MODE=BDCBIN is selected.
- INPUT=label
- The symbolic address of the field containing the value to be
converted.
When NUMBCD=NO, the input parameter addresses a 5-byte field containing the
following:
- Byte 0-1 - EBCDIC hour
- Byte 2-3 - EBCDIC minutes
- Byte 4 - an alpha character from the list A, N, P or M representing AM,
NOON, PM or Midnight, respectively.
When NUMBCD=YES, the input parameter addresses a 4-byte field containing
the following:
- Byte 0-1 - EBCDIC hour
- Byte 2-3 - EBCDIC minutes
- OUTPUT=label
- The symbolic address of a 2-byte field which will contain the number of
minutes after midnight upon return from this macro. No alignment is
necessary for this field.
- MODE=BINBCD
- Indicates that the conversion is from binary to EBCDIC.
- INPUT=label
- The symbolic address of the field containing the value to be
converted. When MODE=BINBCD, this parameter references a 2-byte field
containing a binary number less than 1440. No error checking is done on
this value.
- OUTPUT=label
- The symbolic address of a 5-byte field which will contain the following
upon return from this macro.
- Byte 0-1 - EBCDIC hour
- Byte 2-3 - EBCDIC minutes
- Byte 4 An alpha character from the list A, N, P or M representing AM,
NOON, PM or Midnight, respectively.
- RGEVEN=Re
- The even numbered register of a consecutive even-odd register pair.
- WORK=label
- The symbolic address of an 8-byte work area aligned on a doubleword
boundary.
Entry Requirements
None.
Return Conditions
- Control is returned to the next sequential instruction.
- The contents of the registers referenced by RGEVEN are unknown. The
contents of all other registers are preserved across this macro call.
Programming Considerations
- This macro can be executed on any I-stream.
- The 8-byte field referenced by the WORK parameter must be aligned on a
doubleword boundary.
- Both registers of the consecutive even-odd pair referenced by the RGEVEN
parameter will be used. The contents of these registers will not be
saved.
- Erroneous input data will cause the output from this macro to be
invalid. For example, binary input greater than or equal to 1440 causes
invalid output.
Examples
ANYNAME TMCNA MODE=BCDBIN,NUMBCD=YES,INPUT=EBW010,OUTPUT=EBW014,
WORK=EBW024,RGEVEN=R2