I'm having hard time on simply read a SYSIN.
I have two program with almost the same structure, the first invoke UCBSCAN (to check wether a device is online/offline), the second
invoke IEEVARYD to perform vary online/offline on device or range of device.
They're both AMODE 31 / RMODE ANY / Re-entrant, they both read a sysin file as input.
The main difference is that the second one resides in an APF-Authorized LOADLIB and Authorization Code = 1 (Pre-requisite for IEEVARYD since
it must execute in SUPERVISOR MODE).
While the first one do the job, the second one gives me a S337-04 on the SYSIN file as if the EODAD was not provided in the DCB.
As soon as i remove my LOADLIB from APF I get a RC=0.
Here's some details :
1) Acquire some memory
..
STORAGE OBTAIN,LENGTH=WK31LG,ADDR=(R3),LOC=31
..
STORAGE OBTAIN,LENGTH=WK24LG,ADDR=(R5),LOC=24
...
STORAGE OBTAIN,LENGTH=WK31LG,ADDR=(R3),LOC=31
..
STORAGE OBTAIN,LENGTH=WK24LG,ADDR=(R5),LOC=24
...
2) I used two work-area : WORK31 in loc=31 and WORK24 in loc=24 for the DCB, here's their contents :
WORK 31
WORK31 CSECT
WORK31 RMODE ANY
SAVE DS 18F SAVE AREA DU PROG.
*-
*- DCBE POUR FICHIER SYSIN
SYSIN_E DCBE EODAD=ENDFIC,RMODE31=BUFF
*- MACRO LIST FORM
WOPEN OPEN (*-*),MODE=31,MF=L
WCLOSE CLOSE *-*,MODE=31,MF=L
WORK31 RMODE ANY
SAVE DS 18F SAVE AREA DU PROG.
*-
*- DCBE POUR FICHIER SYSIN
SYSIN_E DCBE EODAD=ENDFIC,RMODE31=BUFF
*- MACRO LIST FORM
WOPEN OPEN (*-*),MODE=31,MF=L
WCLOSE CLOSE *-*,MODE=31,MF=L
And WORK24
.
WORK24 CSECT
WORK24 RMODE ANY
*- DCB DES FICHIERS SYSPRINT/SYSIN
SYSIN DCB DDNAME=SYSIN,DSORG=PS,MACRF=GM,DCBE=SYSIN_E
WORK24 CSECT
WORK24 RMODE ANY
*- DCB DES FICHIERS SYSPRINT/SYSIN
SYSIN DCB DDNAME=SYSIN,DSORG=PS,MACRF=GM,DCBE=SYSIN_E
3) Perform the OPEN
OPEN_FIC RSECT
OPEN_FIC AMODE 31
OPEN_FIC RMODE ANY
USING WORK31,R13 ADRESSABILITé DE WORK31
USING WORK24,R6 ADRESSABILITé DE WORK24
BASR R12,0
USING *,R12 ADRESSABILITé DE OPEN_FIC
OPEN (SYSIN,(INPUT)),MF=(E,WOPEN),MODE=31
OPEN (SYSPRINT,(OUTPUT)),MF=(E,WOPEN),MODE=31
PR FIN OPEN_FIC
...
OPEN_FIC AMODE 31
OPEN_FIC RMODE ANY
USING WORK31,R13 ADRESSABILITé DE WORK31
USING WORK24,R6 ADRESSABILITé DE WORK24
BASR R12,0
USING *,R12 ADRESSABILITé DE OPEN_FIC
OPEN (SYSIN,(INPUT)),MF=(E,WOPEN),MODE=31
OPEN (SYSPRINT,(OUTPUT)),MF=(E,WOPEN),MODE=31
PR FIN OPEN_FIC
...
Read the SYSIN
LECTURE GET SYSIN,PARMREC
NEXT_STEP PUT SYSPRINT,PARMREC
BC 15,LECTURE
ENDFIC EQU *
....
NEXT_STEP PUT SYSPRINT,PARMREC
BC 15,LECTURE
ENDFIC EQU *
....
And CLOSE it
CLOS_FIC RSECT
CLOS_FIC AMODE 31
CLOS_FIC RMODE ANY
USING WORK31,R13 ADRESSABILITé DE WORK31
USING WORK24,R6 ADRESSABILITé DE WORK24
BASR R12,0
USING *,R12 ADRESSABILITé DE CLOS_FIC
CLOSE (SYSIN),MF=(E,WCLOSE),MODE=31
CLOSE (SYSPRINT),MF=(E,WCLOSE),MODE=31
PR FIN CLOS_FIC
CLOS_FIC AMODE 31
CLOS_FIC RMODE ANY
USING WORK31,R13 ADRESSABILITé DE WORK31
USING WORK24,R6 ADRESSABILITé DE WORK24
BASR R12,0
USING *,R12 ADRESSABILITé DE CLOS_FIC
CLOSE (SYSIN),MF=(E,WCLOSE),MODE=31
CLOSE (SYSPRINT),MF=(E,WCLOSE),MODE=31
PR FIN CLOS_FIC
And here is the result
IEC024I 337-04,IFG0552X,SAPIARD,VARYDA$D,SYSIN
IEA995I SYMPTOM DUMP OUTPUT 759
SYSTEM COMPLETION CODE=337 REASON CODE=00000004
TIME=14.46.05 SEQ=15441 CPU=0000 ASID=0032
PSW AT TIME OF ERROR 075C1000 80E00B56 ILC 2 INTC 0D
NO ACTIVE MODULE FOUND
NAME=UNKNOWN
DATA AT PSW 00E00B50 - 41003846 0A0DB20A 00509808
AR/GR 0: 9458A5D6/00E00D60 1: 00000000/A4337000
2: 00000000/00006D40 3: 00000000/00E0051A
4: 00000000/009B7420 5: 00000000/00E17000
6: 00000000/009B76C4 7: 00000000/009B771C
8: 00000000/009B76E4 9: 00000000/009B8EC0
A: 00000000/00000000 B: 00000000/009B8070
C: 00000000/009B8EC0 D: 00000000/00000028
E: 00000000/00E0097C F: 00000000/00000004
END OF SYMPTOM DUMP
IEF450I SAPIARD VARYDA$D - ABEND=S337 U0000 REASON=00000004
IEA995I SYMPTOM DUMP OUTPUT 759
SYSTEM COMPLETION CODE=337 REASON CODE=00000004
TIME=14.46.05 SEQ=15441 CPU=0000 ASID=0032
PSW AT TIME OF ERROR 075C1000 80E00B56 ILC 2 INTC 0D
NO ACTIVE MODULE FOUND
NAME=UNKNOWN
DATA AT PSW 00E00B50 - 41003846 0A0DB20A 00509808
AR/GR 0: 9458A5D6/00E00D60 1: 00000000/A4337000
2: 00000000/00006D40 3: 00000000/00E0051A
4: 00000000/009B7420 5: 00000000/00E17000
6: 00000000/009B76C4 7: 00000000/009B771C
8: 00000000/009B76E4 9: 00000000/009B8EC0
A: 00000000/00000000 B: 00000000/009B8070
C: 00000000/009B8EC0 D: 00000000/00000028
E: 00000000/00E0097C F: 00000000/00000004
END OF SYMPTOM DUMP
IEF450I SAPIARD VARYDA$D - ABEND=S337 U0000 REASON=00000004
I'm googling to see what i'm missing about APF, but if you have an idea (I suppose, as usual, it's too big to miss ... )