Date Mask

To format date fields, use the SAPscript SET DATE MASK command. Executing this command causes all subsequent date fields to be printed with the specified formatting.

Syntax

/: SET DATE MASK ='date_mask'

The following templates may be used in the date mask:

DD day (two digits)
DDD name of day (abbreviated)
DDDD name of day (written out in full)
MM month (two digits)
MMM name of month (abbreviated)
MMMM name of month (written out in full)
YY year (two digits)
YYYY year (four digits)

LD day (formatted as for the L option)
LM month (formatted as for the L option)
LY year (formatted as for the L option)

Any other characters occurring in the mask are interpreted as simple text and are copied directly to the output.

Assuming a current system date of March 1st, 1997.

/: SET DATE MASK = 'Foster City, MM.DD.YY'
&DATE& -> Foster City, 03.01.97
&DATE(Z)& -> Foster City, 3.1.97

/: SET DATE MASK = 'MMMM DD, YYYY'
&DATE& -> March 01, 1997

You can revert to the standard setting by using the SET DATE MASK command again with an empty string in place of the date mask:

/: SET DATE MASK = ' '