irishdragon
Programmer
If the ET error table or the UV duplicate tables are created, I want to rename them with the system date and time. The variables &sysdate includes slashes ('/'), and the variable &systime includes colons (':'). I want to rename these tables without the / and :. Currently, we use the day of week and the number of records in the table, like THU20, for example. Not very descriptive or useful.
Is there a way to eliminate the / and : and rename tables using the date and time?
Here's our current code:
.IF &SYSRC > 0 THEN;
.LOGOFF &SYSRC;
.ENDIF;
.SET RETURNCD TO &SYSRC;
.IF &SYSETCNT > 0 THEN;
.SET RETURNCD TO 01;
RENAME TABLE SERVICE_ASSURANCE.ET_TATD810_STG_LSR_FOC
TO SERVICE_ASSURANCE.ET_TATD810_STG_LSR_FOC_&SYSDAY&SYSETCNT;
.IF &SYSRC <> 0;
.DISPLAY 'ET RENAME UNSUCCESSFUL' TO FILE SYSPRINT;
.LOGOFF &SYSRC;
.ENDIF;
.ENDIF;
.IF &SYSUVCNT > 0 THEN;
.SET RETURNCD TO 02;
RENAME TABLE SERVICE_ASSURANCE.UV_TATD810_STG_LSR_FOC
TO SERVICE_ASSURANCE.UV_TATD810_STG_LSR_FOC_&SYSDAY&SYSUVCNT;
.IF &SYSRC <> 0;
.DISPLAY 'UV RENAME UNSUCCESSFUL' TO FILE SYSPRINT;
.LOGOFF &SYSRC;
.ENDIF;
.ENDIF;
.IF &SYSETCNT > 0 AND &SYSUVCNT > 0 THEN;
.SET RETURNCD TO 03;
.ENDIF;
Is there a way to eliminate the / and : and rename tables using the date and time?
Here's our current code:
.IF &SYSRC > 0 THEN;
.LOGOFF &SYSRC;
.ENDIF;
.SET RETURNCD TO &SYSRC;
.IF &SYSETCNT > 0 THEN;
.SET RETURNCD TO 01;
RENAME TABLE SERVICE_ASSURANCE.ET_TATD810_STG_LSR_FOC
TO SERVICE_ASSURANCE.ET_TATD810_STG_LSR_FOC_&SYSDAY&SYSETCNT;
.IF &SYSRC <> 0;
.DISPLAY 'ET RENAME UNSUCCESSFUL' TO FILE SYSPRINT;
.LOGOFF &SYSRC;
.ENDIF;
.ENDIF;
.IF &SYSUVCNT > 0 THEN;
.SET RETURNCD TO 02;
RENAME TABLE SERVICE_ASSURANCE.UV_TATD810_STG_LSR_FOC
TO SERVICE_ASSURANCE.UV_TATD810_STG_LSR_FOC_&SYSDAY&SYSUVCNT;
.IF &SYSRC <> 0;
.DISPLAY 'UV RENAME UNSUCCESSFUL' TO FILE SYSPRINT;
.LOGOFF &SYSRC;
.ENDIF;
.ENDIF;
.IF &SYSETCNT > 0 AND &SYSUVCNT > 0 THEN;
.SET RETURNCD TO 03;
.ENDIF;