How to: |
MONTHNAME returns a character string that contains the data-source-specific name of the month for the month part of a date expression.
MONTHNAME(date_exp)
where:
Is a date or date-time expression.
The following request returns the name of the month from the TRANSDATE field.
TABLE FILE EMPLOYEE PRINT HIRE_DATE COMPUTE TRANSDATE/YYMD= HIRE_DATE; NOPRINT COMPUTE MONTHNAME1/A12 = MONTHNAME(TRANSDATE); BY TRANSDATE ON TABLE SET PAGE NOLEAD ON TABLE SET STYLE * GRID=OFF,$ ENDSTYLE END
The output is shown in the following image.