IBM Version 4 Universal Remote User Manual


 
ALLDONE: ENDPGM
As an alternative to using the job log, the following RPG program uses the error
code structure to receive error messages:
Hᑍ ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
H
Hᑍ MODULE: ERRCODE
H
Hᑍ LANGUAGE: RPG
H
Hᑍ FUNCTION: THIS APPLICATION DEMONSTRATES THE USE OF THE
Hᑍ ERROR CODE PARAMETER.
H
Hᑍ APIs USED: QHFRTVAT, QHFCRTDR
H
Hᑍ ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
Hᑍ ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
H
Hᑍ THIS PROGRAM DOES SOME SIMPLE VERIFICATION ON AN HFS
Hᑍ DIRECTORY. THE QHFRTVAT API IS USED TO VERIFY THE EXISTENCE
Hᑍ OF THE SPECIFIED DIRECTORY. IF THE DIRECTORY DOES NOT EXIST, ᑍ
Hᑍ AN ATTEMPT IS MADE TO CREATE THE DIRECTORY.
H
Hᑍ THERE ARE THREE PARAMETERS TO THIS PROGRAM
H
Hᑍ 1 INPUT PATHNM - NAME OF DIRECTORY
Hᑍ 2 INPUT PATHLN - LENGTH OF PATHNM PARAMETER
Hᑍ 3 OUTPUT SUCCES - INDICATES SUCCESS OR FAILURE
Hᑍ '' SUCCESS
Hᑍ '1' FAILURE
Hᑍ ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
ISUCCES DS
I B 1 4RETCOD
IPLENG DS
I B 1 4PATHLN
IBINS DS
I B 1 4RETDTA
I B 5 8ATTRLN
IERROR DS
I B 1 4BYTPRV
I B 5 8BYTAVA
I 9 15 ERRID
I 16 16 ERR###
I 17 272 INSDTA
C ᑍENTRY PLIST
C PARM PATHNM 8
C PARM PLENG
C PARM SUCCES
C
Cᑍ INITIALIZE BYTES PROVIDED AND THE ATTRIBUTE LENGTH VARIABLE
C
C Z-ADD272 BYTPRV
C Z-ADD ATTRLN
C
Cᑍ RETRIEVE DIRECTORY ENTRY ATTRIBUTES
C
C CALL 'QHFRTVAT'
C PARM PATHNM
C PARM PATHLN
C PARM ATTR 1
C PARM ATTRLN
C PARM ATTR
C PARM ATTRLN
C PARM RETDTA
C PARM ERROR
C
Cᑍ CHECK FOR DIRECTORY NOT FOUND OR FILE NOT FOUND ERRORS.
Cᑍ IF WE RECEIVE ONE OF THESE THIS IS THE INDICATION THAT
Cᑍ WE CAN TRY TO CREATE THE DIRECTORY.
C
C BYTAVA IFEQ ᑍZERO
Chapter 2. Getting Started with APIs
2-11