IBM Security Z Security

 View Only

 (re) formatting the TOD output in zSecure reports

Eamonn McGrath's profile image
Eamonn McGrath posted Tue August 12, 2025 08:34 AM

When writing an Access Monitor CARLa query in zSecure (Type=Access) I have two define statements:


These definitions were generated by the product for use on the Summary output. 

However, for the first nine days of a month in the output is formatted to <space>day instead of <zero>day example below

This is very annoying when formatting this into excel for management reports as excel does not like the <space>day dates.  

I have tried changing the last_tod to last_datetime and still cannot get it to change the space to a zero

Any ideas how I can within CARLa format this output from " 1 Aug 2025" to "01 Aug 2025" 

Eamonn

Rob van Hoboken's profile image
Rob van Hoboken IBM Champion

The LAST_TOD field is, as the name states, an 8 byte Time of Day (clock) value.  The only format available is .... TOD and this support different lengths but not much more customization.

If you want flexibility in formatting your time stamp, you could convert the LAST_TOD field to, e.g., DATETIME or SMFTIMESTAMP using

define last_smfstamp as convert(last_tod,tod,smftimestamp)

CONVERT is described here.

However, you can also extract just the DATE part of the timestamp:

define last_date as convert(last_tod,tod,date)

as this allows for a range of format, such as $date and eudate.  Note, the defined fields cannot be used as statistics (MIN, MAX) in the SUMMARY command, so you keep using the TOD fields for summary.  Also, the CONVERT function works on the input data, you cannot CONVERT the result of a summary statistic.