OPS/MVS

 View Only

 Can OPSLOG Extract date include the year?

Robert Stark's profile image
Robert Stark posted Jun 04, 2025 01:19 AM

I am using OPSLOG(EXTRACT OUTCOLS(MSGNO,DATE,TIMESTMP) ...)

The date I get back looks like 31MAY (with no year).

Is there an easy way to get the year? It will be tricky when it is January or February and I extract a date that is 27DEC. I could code up how to window back to a previous year, but I'd prefer to have a way for OPS/MVS to give it to me in something like yyyymmdd format.

Regards,

Bob Stark

Marcel van Ek's profile image
Marcel van Ek

Hi Bob, god one.  I've aso wondered how to extract that with the OPSLOG() function and id not think it was possible? Maybe we need to create a request for that ;).   I know that pressing ENTER while positioning the cursor on a line in OPSLOG will show you the year in panel OP100005, so should be (made) possible. As well as showing it in a column in opsview 1  (make a column LDATE for instance to show a long date? )

Hennie Hermans's profile image
Broadcom Employee Hennie Hermans

Hi Bob, (and Marcel),

In the OPSLOG EXTRACT function you should be able to specify the format of the DATE returned...
By default it is ddmmm, but you can add the year.
See here the DATE parameter in the function:

 

See if specifying DATE(ddmmmyy) or DATE(ddmmmyyyy) solves the issue..

Best regards
Hennie Hermans

Marcel van Ek's profile image
Marcel van Ek

Hennie, you're referring to the extract value of DATE, not the RETURNED value of DATE. 

This is not working.