Site hosted by Angelfire.com: Build your free website today!
Master Menu - Links the Master Page


Columns . . . :                     Edit                         GOLFP/QRPGSRC
 SEU==>_______________________________________________________        DATE_INFO 
 FMT H  HKeywords++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
        *************** Beginning of data ************************************* 
     H

     F*-----------------------------------------------------------------------
     F*-                        DATE_INFO ©                                ---
     F*-                  Author:  Browning, 01/06/2001                    ---
     F*-                                                                   ---
     F*-                 PURPOSE:  To allow the 'GETDTE' program to be     ---
     F*-                           tested, and to provide a brief tutorial ---
     F*-                           on how to handle dates.                 --- 
     F*ILENAME++IPEASFRlen+LKlen+AIDevice+.Keywords+++++++++++++++++++++++++
      *-- Here we define the DDS for the Window screen definition
     FDATESCRN  CF   E             WORKSTN
      *---------------------------------------------------------------------
      *-- My system stors dates in ISO format and the value '00010101' is
      *-- the lowest possible value an ISO date can contain
     D VALID           C                   CONST('00010101')
      *-- VALID2 is a date constant that is used incase the USER chooses a 
      *-- date that isn't a valid ISO date. The date of January 1 1900 is an 
      *-- arbitrary date that the 'GETDTE' program will process without causing
      *-- an error to be returned to this program
     D VALID2          C                   CONST('19000101')
      *-- This Data Structure allows all the fields to be initalized with one
      *-- 'RESET' statement
     D DATA            DS
     D DATE                           8A
     D ANY1                          28A
      *-- Notice that this field will display a 10 char date ie: CCYY-MM-DD
     D ISODATE                         D   DATFMT(*ISO-)
      *---------------------------------------------------------------------
      *-- This DO-while loop will iterate until the user presses the 'F3' key
     C                   DOW       *IN03 = *OFF
      *-- Display the 'SCRN1' record format and wait until the user presses 
      *-- ENTER
     C                   EXFMT     SCRN1
      *-- When a key is presses see if it was the 'F3' key
     C                   IF        *IN03 = *ON
      *-- if it was the 'F3' key exit the DO-while loop and controll drops to
      *-- the next line of code following the 'ENDDO' statement
     C                   LEAVE
     C                   ELSE
      *-- if it wasn't the 'F3' key check what the USER entered for a date
      *-- The factor 1 value *ISO0 along with the operation code 'TEST' 
      *-- instructs the computer to check the result field 'DATE' for a valid
      *-- ISO date
      *-- Note the 0 following the factor one entry. It specifyes that the date
      *-- doesnt have dash marks contained in the field, hence the field 
      *-- length of 'DATE' is allowed to be 8 char ( which lools like this: 
      *-- 'CCYYMMDD')and not 10 char ( which looks like this: 'CCYY-MM-DD') 
      *-- Any valid date format with work in the factor 1 entry, so long as the
      *-- result field is of the same type
     C     *ISO0         TEST  (D)               DATE                   40
      *-- After the test is performed we have one of two things
      *-- If *IN40 is on the following two lines of code will execute
      *-- Simply stated if *in40 is on move the 'VALID' field into the ISODATE
      *-- field, this is then displayed to the user the next time the screen is
      *-- redisplayed. We also want to pass the predetermined date to the 
      *-- program 'GETDTE. 
     C   40*ISO0         MOVE      VALID         ISODATE
     C   40              MOVEL     VALID2        ANY1
      *-- If *IN40 is off these two will execute, and place the USER selected
      *-- date into the 'ISODATE' field and display it the next time the screen
      *-- is redisplayed, it also places the 'DATE' field into the 
      *-- ANY1 (28 alpha) field which is then passed to the 'GETDTE' program
     C  N40*ISO0         MOVE      DATE          ISODATE
     C  N40              MOVEL     DATE          ANY1
      *-- CALL the PGM 'GETDTE' & UPON RETURNING DISPLAY THE DATE PARTICULARS
     C                   CALL      'GETDTE'
     C                   PARM                    ANY1
      *-- After returning from the CALL display the SCRN1 record again 
      *-- with the updated field 'ISODATE' and 'ANY1' fields
     C                   EXFMT     SCRN1
      *-- After viewing the result pressing ENTER clears the Data Structure
      *-- 'DATA' and executes the next iteration of the DO-while loop
     C                   RESET                   DATA
     C                   ENDIF
     C                   ENDDO
      *-- When the 'F3' key is pressed *IN03 is turned on the LEAVE statement 
      *-- is now executed and controll of the program is passed to the 
      *-- following two lines of code that end the program. 
     C                   EVAL      *INLR = *ON
     C                   RETURN


Copyright ©1998 - 2001 J. Browning - All rights reserved.
Master Menu - Links the Master Page