Consultor Eletrônico



Kbase 19457: AS/400 Native 4GL not recognizing 9999/12/31 as a date
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   09/05/2003
SUMMARY:

This solution applies to Progress/400.
You might encounter a problem with the Native 4GL recognizing 9999/12/31 as a valid date.

EXPLANATION:

Given the following:
- DBASE2 is a Progress/400 8.0C60 server schema library created with ALWPROUNK(*NO) specified.
- DBTABLE2 is a table of DBASE2
- TESTDATE is a date field in DBTABLE2 value "9999-12-31"

This program:

DEF VAR RES1 AS INT.
DEF VAR RES2 AS INT.
DEF VAR RES3 AS INT.
DEF VAR RES4 AS INT.
DEF VAR RES5 AS INT.
ASSIGN RES1 = 0 RES2 = 0 RES3 = 0 RES4 = 0 RES5 = 0.

FOR EACH DBASE2.DBTABLE2 NO-LOCK:
IF DBASE2.DBTABLE2.TESTDATE = TODAY THEN ASSIGN RES1 = RES1 + 1.
ELSE IF DBASE2.DBTABLE2.TESTDATE < TODAY
THEN ASSIGN RES2 = RES2 + 1.
ELSE IF DBASE2.DBTABLE2.TESTDATE > TODAY
THEN ASSIGN RES3 = RES3 + 1.
ELSE IF DBASE2.DBTABLE2.TESTDATE = ?
THEN ASSIGN RES4 = RES4 + 1.
ELSE ASSIGN RES5 = RES5 + 1.
END.

OUTPUT TO '/TEST.OUT'.

DISPLAY ' RES1 = ' RES1.
DISPLAY ' RES2 = ' RES2.
DISPLAY ' RES3 = ' RES3.
DISPLAY ' RES4 = ' RES4.
DISPLAY ' RES5 = ' RES5.

If you receive the erroneous result: RES4 = 1, follow these instructions:

The native 4GL requires these two files to correct this situation: as4-sync.p and as4-sync.r

These files can be found on each Progress/400 8.0C60 patch. The normal procedure for installing Progress/400 patches will not install these modules. They must be loaded manually.

1. Download the patch from:
http://www.progress.com/patches/

2. Uncompress the file, it contains a save file (i.e. 80C65.SAV) which must be placed on the AS/400

3. Create a temporary library:
CRTLIB LIB(IVTEMP) TEXT('temp library')

4. Create a save file on AS/400:
CRTSAVF FILE(IVTEMP/P865SF)

5. On the PC:
6. At the command prompt, enter: ftp AS400-system

7. Sign on with an AS/400 user-id and password, and change to binary, enter 'binary'

8. Transfer the file: put c:\80c65.sav IVTEMP/P865SF

9. At the AS/400 command prompt:
10. Create a save file on AS/400:
CRTSAVF FILE(IVTEMP/P860)

11. Make a backup of '/dlc/src/as4dict':
SAV DEV('QSYS.LIB/IVTEMP.LIB/P860.FILE') OBJ(('/dlc/src/as4dict'))

12. Restore the files from P865SF:
RSTOBJ OBJ(*ALL) SAVLIB(PROPATCH) DEV(*SAVF) SAVF(IVTEMP/P865SF) RSTLIB(IVTEMP)

13. Change the current directory: cd '/dlc/src/as4dict'

14. Restore the files:
RST DEV('/QSYS.LIB/IVTEMP.LIB/#DLC#.FILE') OBJ(('*'))

If you no longer require the patch files, you may delete library IVTEMP.