19.12.2019

How To Get System Date In Cl Program

How To Get System Date In Cl Program Rating: 9,3/10 3843 reviews

RTVDATE (Retrieve and Convert Date) Command The RTVDATE command converts a date to the user-specified date format. It optionally adds a duration (number of days) to the date before it is converted. The date that is converted my be specified on the DATE parameter or a symbolic date (such as.JOB or.SYSTEM) may be retrieved and converted. The returned date value is in the user-specified date format after the optional duration has been added (note a negative duration may be specified to subtract a number of days). RTVDATE RTNDATE( CL-var ) RTNFMT(.JOB date-format ) + DATE(.JOB date operator relative-day ) + DUR( 0 duration.DAYS.MONTHS.YEARS ) If the day is returned in.YMD format and the date is 7 August 2012, the date is returned as 120807 never 12/08/07.

To include date separators (aka, 'date edit codes') specify the format on the RTNFMT parameter with the separators, for example, RTNFMT('YY/MM/DD') returns the date as 12/08/07. In addition a duration can be applied to the date. The duration is added to the user-supplied date or the special date value and the new date is returned. Below is an example of the prompted RTVDATE command. Required Parameters The RTNDATE parameter accepts a character or numeric CL variable that receives the returned date value. The format of the date value that is returned is specified on the RTNFMT parameter. This CL variable should be large enough to hold the entire returned date string.

If it is not large enough, the returned date value is truncated on the left. Optional Parameters The RTNFMT parameter specifies the format of the date to be returned on the RTNDATE parameter. All the usual predefined date format codes are supported, in addition any combination of MM DD, YYYY or YY may be specified including DDD, MMM, Y, YY, and YYYY. For example to return the date of 7 August 2012 as 07AUG2012, specify RTNFMT(DDMMMYYYY).

Sql System Date

How To Get System Date In Cl Program

How To Get System Date In Java

To suppress leading zeros, specify the letter 'Z' in place of the M, D or Y where you want the zeros suppressed. For example, RTNFMT('ZMDDYY') returns the date 8 August 2012 as '80712'. To include data separator characters within the returned date, use a custom date format code for this parameter. For example, to return the date 7 August 2012 in YYMD format with separators, specify the date format as 'YYYY/MM/DD'.

The returned date will be '2012/08/07'. The DATE parameter identifies the date to be returned. This parameter is made up of 3 components although only 1 is required to retrieve a valid date. Date - The date to be returned. This can be a real date in CL date format (which is specified in standard CL command date format: CYYMMDD or MMDDYY or the job date format) or one of the following symbolic dates values:.JOB - The job date.SYSTEM - The system date.JOBSTART - The date the job entered the system; the 'job start' date.YESTERDAY - Yesterday's date based on the system date.TODAY - Today's date based on the system date.TOMORROW - Tomorrow's date based on the system date.BOM - use the first of the month for the current system date.EOM - Use the end of month date for the current system date. Operator - This value controls the actual date returned relative to the Date. It is used in conjunction with Relative Date value.