Can I print SYSDATE with a leading blank instead of zero?
search cancel

Can I print SYSDATE with a leading blank instead of zero?

book

Article ID: 31094

calendar_today

Updated On:

Products

PanAudit Plus Easytrieve Report Generator PAN/SQL

Issue/Introduction

In Release 6.4, EZTPOPT parameter DATEMLC  can be set to either Z or B.  
When the first digit of month or day is a one-digit value, that value will be reflected as a Zero or Blank, respectively.

However, as documented on page 23 of the 11.6 Release Notes, the DATEMLC parameter is now unsupported:

Unsupported Options

The following options are no longer supported in r11. Determine if any of these options are used at your site to understand how your programs could be affected.

DATEMLC

The DATEMLC option that was available in the 6.X release is no longer an option in r11. Instead, the DATEMLC processing is now always equivalent to setting DATEMLC to Z (leading zero on single digit months). When the first part of a date field, (month or day), is a one-digit value, that value will be prefixed with a leading zero. There is no built-in option to replace that leading zero with a blank.

If programs compiled under 6.4 0311 are now getting a blank instead of the leading zero when run under CA Easytrieve Report Generator r11 and you wish to simulate 6.4 0311 DATEMLC=B, you can copy the 6.4 EZTPOPT load module to the r11 CAILIB.

 

The user can manipulate the date programmatically. 
Here is an example to replace the leading zero with space:

...

DEFINE W-DATE        W       10  A
DEFINE W-DATE-BYTE   W-DATE   1  A  OCCURS 10
*
JOB  INPUT (NULL) 
*
DISPLAY 'display sysdate: ' SYSDATE
W-DATE = SYSDATE
DISPLAY 'display w-date:  ' W-DATE
*
IF W-DATE-BYTE (1) = '0'
    W-DATE-BYTE (1) = ' '
END-IF
*
DISPLAY 'display w-date:  ' W-DATE
PRINT  REPT1 
STOP 
*
 REPORT REPT1  SPACE 3 LINESIZE 85 +  
        PAGESIZE(11 0) 
*
TITLE  1 '**  Test-Report - printing customized SYSDATE **'   
 LINE   1 W-DATE                                                      

...

The resulting display is:

...

display sysdate: 07/01/15
display w-date:  07/01/15 
display w-date:   7/01/15 

.

The resulting report is:

07/01/15          **  Test-Report - printing customized SYSDATE **    PAGE         1

                                       W-DATE

                                      7/01/15 

 

TEC449382 and TEC265264 also discussed this but referred to unsupported versions so those documents have been withdrawn.

Environment

Release:
Component: EZTRVE