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* \
ISUCCES DS
I B 1 4 0 RETCOD
IPLENG DS
I B 1 4 0 PATHLN
IBINS DS
I B 1 4 0 RETDTA
I B 5 8 0 ATTRLN
IERROR DS
I B 1 4 0 BYTPRV
I B 5 8 0 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-ADD 272 BYTPRV
C Z-ADD 0 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
C Z-ADD 0 RETCOD
C ELSE
C 'CPF1F02' IFEQ ERRID
C 'CPF1F22' OREQ ERRID
C*
C* THERE IS NO NEED TO REINITIALIZE THE ERROR CODE PARAMETER.
C* ONLY BYTES PROVIDED IS INPUT TO THE API; IT WILL RESET THE
C* ERROR CODE PARAMETER FOR US. AFTER THE CALL TO QHFCRTDR,
C* BYTES AVAILABLE WILL EITHER BE ð IF SUCCESSFUL OR NONZERO
C* IF THE CREATE FAILS. WE DO NOT HAVE TO WORRY ABOUT THE
C* PREVIOUS ERROR CODE BEING LEFT IN THE ERROR CODE PARAMETER.
C*
C CALL 'QHFCRTDR'
C PARM PATHNM
C PARM 20 PATHLN
C PARM ATTR 1
C PARM 0 ATTRLN
C PARM ERROR
C BYTAVA IFEQ *ZERO
C Z-ADD 0 RETCOD
C ELSE
C Z-ADD1 RETCOD
C END
C*
C ELSE
C Z-ADD1 RETCOD
C END
C END
C*
C* PROGRAM END
C*
C SETON LR
阅读(1320) | 评论(0) | 转发(0) |