IBM Support

Converting a Julian Date to MMDDYY Format Using SQL

Troubleshooting


Problem

This document describes a method that can be used to convert a five-digit numeric field in the format of YYDDD into a date data type.

Resolving The Problem

Following is a method that can be used to convert a five-digit numeric field with Julian Date data in the form YYDDD into a field with a date data type:

SELECT   DATE('19'||DIGITS(yyddd)) from library/file

To have the results returned in a certain date format, add the CHAR function. If the format of the current job is desired, typically MMDDYY, use the following:

SELECT   CHAR(DATE('19'||DIGITS(yyddd))) from library/file

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"6.1.0"}]

Historical Number

29901454

Document Information

Modified date:
18 December 2019

UID

nas8N1016596