YEAR224 Macro
This macro can be used to complement a 2-digit year field, which is supplied as input, with a 2-digit century field, depending on a specified 100 year window relative to the current year.
Format
Requirements for the caller
- AMODE:
- 24 or 31
- RMODE:
- ANY
- ASC Mode:
- Primary
Parameters
- YEAR=address|(rx)
- Specifies the address of a 4-byte area that contains the 2-digit year input in the form "..yy". The content of substring ".." is ignored on input and is replaced by the century on output, resulting in a 4-digit year "yyyy". For register notation (rx), register 2 through 12 can be used.
- WINDOW=number|20|(rx)
- Specifies a number between 0 and 99, that is interpreted as the forward width of a 100 year window relative to the current year. The default is 20. For register notation (rx), register 2 through 12 can be used.
- LINK=YES|NO
- Determines how the service routine is invoked. With the default
LINK=NO, the macro invokes, by default, the SVA phase $IJBY224 (no
link-editing is required). With LINK=YES, the macro invokes IJBY224S
as the default CSECT for link-editing. In both cases, you can also
specify your own phase or CSECT name.
LINK=YES means that the call sequence generates an external reference to the entry point of the service routine (CSECT) causing it to be linked with the calling program.
- NAME=name|$IJBY224|IJBY224S
- Specifies a user-defined phase or CSECT as the service routine
to be invoked. If no name is specified, the following default names
are used, as mentioned in the LINK parameter description:
- For LINK=NO, phase name $IJBY224.
- For LINK=YES, CSECT name IJBY224S.
Register usage convention
- (rx)
- For register notation (YEAR and WINDOW parameter) any general register from 2 to 12 can be used.
- Register 0
- Is used for input to pass the WINDOW parameter and returns one
of the following reason codes:
- 0
- No errors (register 15 also contains 0).
- 1
- YEAR input is not numeric.
- 2
- WINDOW is invalid (negative or larger than 99).
- Register 1
- Is used for input to pass the YEAR parameter.
- Register 13
- Is assumed to contain the address of a 72-byte save area.
- Register 14
- Is used as link register.
- Register 15
- Is used at input for the address of the service routine, and returns
one of the following return codes:
- 0
- No errors.
- 8
- Input is invalid, as indicated by the reason code in register 0.
The macro expansion and service routine are both reentrant. The service routine uses the GETIME macro and references the COMREG field SYSDATE to obtain the current date, and is therefore z/VSE-dependent. It can also be used in a CMS environment under VM.
Example
YEAR224 YEAR=yyyy
...
yyyy DC '..02'
In the above example, the macro complements field yyyy to 2002, since 2002 is the year that ends with 02 in the default window (1996-79, 1996+20) = (1917, 2016). Refer to Planning for further details about the default window used.