Presentation is loading. Please wait.

Presentation is loading. Please wait.

Scope and System Time/Date

Similar presentations


Presentation on theme: "Scope and System Time/Date"— Presentation transcript:

1 Scope and System Time/Date
SCOPE TERMINATORS For Your Information FOR THE PROCEDURE DIVISION: A period will end every “open” logical control structure currently begun… NOT (a “used to be rule”!) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ READ INPUT-FD AT END MOVE “yes” TO EOF PERFORM 200-CALC UNTIL EOF = “yes” MOVE INPUT-REC TO OUTPUT-REC WRITE OUTPUT-REC RULE OF THUMB: Always use END-STRUCTURE delimiters and you will only need a period at the end of every paragraph. Indentation has NOTHING to do with the logic of the program!!! Definition: Delimits the end of a logical control construct or the end of a statement with clauses. DELIMITER = a character that begins or ends a unit of data DELIMIT = to fix or define the limits of Examples: END-READ END-PERFORM END-COMPUTE (etc…) period Scope and System Time/Date

2 Scope and System Time/Date
ACCEPT DATE Purpose:  accepts current date from the computer system Syntax Definition: ACCEPT identifier FROM DATE [YYYYMMDD]. Examples: 01 TODAYS-DATE1 PIC 9(6). or… 01 TODAYS-DATE2. 05 TODAYS-YR PIC 99. 05 TODAYS-MM PIC 99. 05 TODAYS-DD PIC 99. ACCEPT TODAYS-DATE FROM DATE. use todays-date1 or todays-date2?! For Your Information The default format for the date is YYMMDD. If using the YYYYMMDD format option, the pic clause for todays-date1 is 9(8) and todays-yr is 9(4). Scope and System Time/Date

3 Scope and System Time/Date
ACCEPT TIME For Your Information The default format for the date is HHMMSSss. The HH is MILITARY TIME! A picture clause of 9(8) could also have been used if you wanted to additional hundredths of seconds. There is a difference between moving a 9(8) to a 9(6) – decimal justifies and truncates to left - and a 9(8) to an alphanumeric group item i.e. x(6) – left justifies and truncates to right. Purpose:  accepts current time from the computer system Syntax Definition: ACCEPT identifier FROM TIME. Examples: 01 TODAYS-TIME1 PIC 9(6). or… 01 TODAYS-TIME2. 05 TODAYS-HR PIC 99. 05 TODAYS-MM PIC 99. 05 TODAYS-SS PIC 99. ACCEPT TODAYS-TIME FROM TIME. Scope and System Time/Date


Download ppt "Scope and System Time/Date"

Similar presentations


Ads by Google