Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

@SET (format 5) - Date and time

&pagelevel(3)&pagelevel

This format of the @SET statement is used to store the date and time in a string variable or a work file. The value is stored starting at a specified column.

Operation

Operands

F mode, L mode

@SET

{svarex | lvar} [,col]={DATE [ISO[4] ] | TIME}

svarex

String variable (#S0..#S20) in which the date or time are to be inserted.
Any characters in the corresponding positions are overwritten.

lvar

Line number variable (#L0..#L20) specifying the line in which the date or
time are to be inserted. If the line does not yet exist, it is created. Any
characters in the corresponding positions are overwritten.

col

Column as of which the date or time are to be stored. If col is not specified
then the values are inserted starting at column 1. If col is located after the
end of the line then the line is filled with blanks up to the column col.

DATE

The current date is inserted in the specified string variable or line in the
desired form. If ISO is not specified then the form mm/dd/yyjjj is used.
Here, mm specifies the month, dd the day, yy the year and jjj the day of
the year.

ISO

ISO4

TIME

Specifies that the date is to be output in the format yy-mm-ddjjj.

Specifies that the date is to be output in the format yyyy-mm-ddjjj.

The time is stored in the specified string variable or line in the form hhmmss.
Here, hh specifies the hours, mm the minutes and ss the seconds.

If the insertion operation causes the line or string variable to exceed the maximum length of 32768 then the statement is rejected with the message EDT5474.

If the information is inserted in a line then the character set depends on the work file. If the current work file already has a character set then the value is inserted in this character set. If the work file is empty and has the character set *NONE then it is assigned the character set EDF041 prior to insertion.

If the information is inserted in a string variable then it is converted into the character set of the string variable before insertion.

In this statement, the statement name may be omitted entirely. In F mode, it is also permissible to omit the statement symbol.

Example

1.     @SET #L0 = 1 -------------------------------------------------- (1)
1.     @SET #L0 = DATE ----------------------------------------------- (2)
1.     @SET #L0 ,13 = DATE ISO --------------------------------------- (3)
1.     @SET #S0 = TIME ----------------------------------------------- (4)
1.     @SET #S0 ,13 = DATE ISO4 -------------------------------------- (5)
1.     @PRINT 1 ------------------------------------------------------ (6)
1.0000 02/07/06038 06-02-07038
1.     @PRINT #S00 --------------------------------------------------- (7)
  #S00 165941      2006-02-07038
(1)The value 0001.0000 is assigned to the line number variable #L0.
(2)The date is inserted in line 1 as of column 1.
(3)The date is inserted in ISO format in line 1 as of column 13.
(4)The time is inserted in the string variable #S00 starting at column 1.
(5)The date in ISO4 format is inserted in the string variable #S00 starting at column 13.
(6)Line 1 is output.
(7)The string variable #S00 is output.