DCB and APF Authorized



High Level Assembler(HLASM) for MVS & VM & VSE

DCB and APF Authorized

Postby sensuixel » Mon Feb 11, 2013 7:39 pm

Hello everyone,

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
...


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               


And WORK24

.
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               
...


Read the SYSIN

LECTURE  GET   SYSIN,PARMREC 
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                 


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


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 ... )
sensuixel
 
Posts: 58
Joined: Mon Feb 21, 2011 8:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DCB and APF Authorized

Postby Peter_Mann » Mon Feb 11, 2013 9:38 pm

Looks like the SYSIN DCB has no end of data routine ?
for example
INPUTF DCB DDNAME=SYSUT1,MACRF=GM,DSORG=PS,EODAD=EOJ
the EOJ routines may look like
EOJ MVI ASA,C'0'
MVC EOJ2+42(8),EDTOTAL
ED EOJ2+42(8),INTOT
MVC PRINT+100(8),EDPAGE
ED PRINT+100(8),INCTN
MVC PRINT+78(19),=C'TOTAL RECORDS READ='
ED PRINT+96(1),EQUAL
MVC EOJ2+40(1),EQUALW
PUT OUTPUTF,PRINT
MVC PRINT,CLPRINT
MVI ASA,C'1'
MVC PRINT+40(33),END
PUT OUTPUTF,PRINT
MVC PRINT,CLPRINT
WTO 'NORMAL END OF JOB ! !'
CLOSE CARDIN
CLOSE INPUTF
CLOSE OUTPUTF
Peter
Peter_Mann
 
Posts: 145
Joined: Fri Jun 24, 2011 7:37 pm
Location: Lowell,AR
Has thanked: 15 times
Been thanked: 3 times

Re: DCB and APF Authorized

Postby Peter_Mann » Mon Feb 11, 2013 9:49 pm

From your code post I do now see
SYSIN_E DCBE EODAD=ENDFIC,RMODE31=BUFF
SYSIN DCB DDNAME=SYSIN,DSORG=PS,MACRF=GM,DCBE=SYSIN_E
sorry to rush to a conclusion
Peter
Peter_Mann
 
Posts: 145
Joined: Fri Jun 24, 2011 7:37 pm
Location: Lowell,AR
Has thanked: 15 times
Been thanked: 3 times

Re: DCB and APF Authorized

Postby sensuixel » Mon Feb 11, 2013 11:45 pm

No problem, thanks for helping me ;)
sensuixel
 
Posts: 58
Joined: Mon Feb 21, 2011 8:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DCB and APF Authorized

Postby steve-myers » Tue Feb 12, 2013 5:41 am

There are several problems with what you posted.
  1. The DCB in the WORK24 CSECT points to the DCBE in the WORK31 CSECT. This is an address constant. After you move the WORK24 and WORK31 CSECTs to their respective work areas, the address constant in the WORK24 copy still points to the DCBE in the WORK31 CSECT, not to the DCBE in the working copy of WORK31. You must update DCBDCBE in the work area copy of the DCB after you have copied the WORK24 CSECT to point to the DCBE in the work area copy of WORK31.
  2. The OPEN_FIC and CLOS_FIC routines share a common problem. You are using PR to exit these routines, but unless you used the PC instruction to call the routines - unlikely, in my opinion - you did not create a linkage stack entry for PR to work with. I seldom use the linkage stack because it is very slow. Use conventional linkage.
  3. You have been told this several times, but you persist in doing this. Use MACRF=GL when using QSAM input. Period. Full stop. End of story.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: DCB and APF Authorized

Postby steve-myers » Tue Feb 12, 2013 11:44 am

As for the S337 ABEND running the program in the APF blessed library. I'm not 100% certain what happened, but I think this is what happened. I am assuming the program in the APF library was linked as reenterable.

OPEN determined the DCBE was located in protected storage because the program was loaded into protected storage because it is reenterable and it is in an APF blessed library. This means the DCBE is not valid Since the DCBE is not valid, it is simply ignored, hence the S337 ABEND. The copy of the program in the "regular" library was not loaded into protected storage, so the DCBE is valid, hence no S337.

I do not have access to an APF blessed library, so I can't test this.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: DCB and APF Authorized

Postby sensuixel » Tue Feb 12, 2013 11:58 am

I didn't know that using the linkage stack was slower than regular linkage.
I used a BAKR to build the linkage stack and then PR to exit (as taught by our instructor recently, but he didn't mentionned the performance issue).

I think your analysis on the DCBE is right, the DCBE must be somehow invalid or ignore.

By the way, my program is reenterable.
sensuixel
 
Posts: 58
Joined: Mon Feb 21, 2011 8:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DCB and APF Authorized

Postby enrico-sorichetti » Tue Feb 12, 2013 12:14 pm

By the way, my program is reenterable.


does not look so, by the snippets posted.

and why the work24 has rmode any ???
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: DCB and APF Authorized

Postby sensuixel » Tue Feb 12, 2013 1:31 pm

You're right, I have modified the RMODE of WORK24 , i've replaced my RSECT by CSECT and removed the RENT option and
it works now ...

But i don't know if the problem comes from the APF or from the RENT (maybe both of it) , i'll go check that in the manuals.
sensuixel
 
Posts: 58
Joined: Mon Feb 21, 2011 8:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DCB and APF Authorized

Postby enrico-sorichetti » Tue Feb 12, 2013 2:02 pm

what You did not show are the steps You took for making a program reentrant
which ( at least in my template for REENTRANT programming are )

1) set up initial addressing
2) getmain savearea
3) save registers

4) getmain 31 bits working storage
5) initialize the 31 bits working storage
... single variable initialization, ore one big MVCL from a constant area

6) getmain 24 bits working storage
7) same as above
*) a big MVCL is appropriate in this case to wove to <writable> storage all the DCBs for example

something like
 EDIT       ENRICO.ISPF.SRC(RENT) - 01.00                   Columns 00001 00072
 Command ===>                                                  Scroll ===> CSR
 ****** ***************************** Top of Data ******************************
 000001          TITLE '<rent prog> template'
 000002 <prog>   $ENTR BASE=(R11,R10),SAVE=RENT,RENT=RENTL
 000003 <prog>   AMODE ...
 000004 <prog>   RMODE ...
 000005 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 000006 *              INITIALIZE WORKING STORAGE
 000007          LA    R4,WORK
 000008          LA    R5,WORKL
 000009          LA    R6,DATA
 000010          LA    R7,DATAL
 000011          MVCL  R4,R6
 000012 *
 000013          ...
 000014          ...
 000015          ...
 000016 *
 000017 DATA     DS    0D
 000018          DCB   DSORG=PO,MACRF=(R),DDNAME=*-*,RECFM=U,EXLST=*-*
 000019          DCB   DSORG=PO,MACRF=(W),DDNAME=*-*
 000020          DCB   DSORG=PO,MACRF=(R),DDNAME=*-*
 000021          OPEN  (*-*,(INPUT)),MF=L
 000022          OPEN  (*-*,(OUTPUT)),MF=L
 000023          CLOSE (*-*),MF=L
 000024          DS    0D
 000025 DATAL    EQU   *-DATA
 000026 *
 000027          ...
 000028          ...
 000029          ...
 000030 *
 000031          eject
 000032 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 000033 *        DYNAMIC WORK AREA
 000034 RENT     DSECT
 000035 SAVE     DS    9D                       SAVE AREA - MUST BE FIRST
 000036          DS    9D
 000037 *
 000038 WORK     DS    0D
 000039 <dcb1>   DCB   DSORG=PO,MACRF=(R),DDNAME=*-*,RECFM=U,EXLST=*-*
 000040 <dcb2>   DCB   DSORG=PO,MACRF=(W),DDNAME=*-*
 000041 <dcb3>   DCB   DSORG=PO,MACRF=(R),DDNAME=*-*
 000042 OPENLST  OPEN  (*-*,(INPUT)),MF=L
 000043 OPENLS2  OPEN  (*-*,(OUTPUT)),MF=L
 000044 CLOSLST  CLOSE (*-*),MF=L
 000045          DS    0D
 000046 WORKL    EQU   *-WORK
 000047 RENTL    EQU   *-RENT
 000048          EJECT
 000049          END   <prog>
 ****** **************************** Bottom of Data ****************************

and ... also why all those csects ???
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Next

Return to Assembler