Here is my 'simplified' program that works perfectly fine for reading a BSAM file.
Code:
...
...
OPEN (INPUTF,INPUT)
OPEN (OUTPUTF,OUTPUT)
LOOP READ DECB1,SF,INPUTF,CARD
CHECK DECB1
LH R1,(DCBBLKSI-IHADCB)+INPUTF
L 15,(DECIOBPT-DECB)+DECB1
LH R0,14(,R15)
SR R1,R0
STH R1,(DCBBLKSI-IHADCB)+OUTPUTF
WRITE DECB2,SF,OUTPUTF,CARD
CHECK DECB2
B LOOP
ABTERM WTO 'THE PROGRAM ABENDED'
NOMORE WTO 'END OF FILE REACHED'
CLOSE INPUTF
CLOSE OUTPUTF
...
...
INPUTF DCB DDNAME=INPUTFL, X
MACRF=(R), X
DSORG=PS, X
LRECL=80, X
BLKSIZE=4560, X
RECFM=FB, X
EODAD=NOMORE, X
SYNAD=ABTERM
OUTPUTF DCB DDNAME=OUTPUTFL, X
MACRF=(W), X
DSORG=PS, X
LRECL=80, X
BLKSIZE=4560, X
RECFM=FB, X
SYNAD=ABTERM
SAVEAREA DS 18F
CARD DS CL4560
IHADECB DSECT=YES
DCBD DSORG=PS,DEVD=DA
* REGISTER EQUATES
Now, I'm trying to use DSECT to modify the same program.
Here is my DSECT definition:
Code:
DATA DSECT
CARD DS CL160
@DATA EQU *-DATA
and here is the part of the program that I've modified accordingly. Everything else remains the same.
I've also removed some lines for simplicity.
Code:
OPEN (INPUTF,INPUT)
OPEN (OUTPUTF,OUTPUT)
USING DATA,R8
LA R0,@DATA
GETMAIN RC,LV=(0),SP=0,LOC=24,BNDRY=PAGE
LR R8,R1
LOOP READ DECB1,SF,INPUTF,CARD
CHECK DECB1
WRITE DECB2,SF,OUTPUTF,CARD
CHECK DECB2
B LOOP
ABTERM WTO 'THE PROGRAM ABENDED'
NOMORE WTO 'END OF FILE REACHED'
CLOSE INPUTF
CLOSE OUTPUTF
howeverm when i execute this program, i'm geting a MAXCC = 08 in assembly with the below error.
Code:
000054 00000000 49+ DC A(CARD) ADDR
** ASMA032E Relocatable value or unresolved symbol found when absolute value req
** ASMA435I Record 323 in SYS1.MACLIB(IHBRDWRS) on volume: R1130A
000058 00000000 50+ DC A(0) ADDR
If i remove CARD and insert the direct address, like 0(,R8) or 0(R8), I get the following error:
Code:
000054 49+ DC A(0(R8)) ADDR
** ASMA035S Invalid delimiter - 0(R8)
** ASMA435I Record 323 in SYS1.MACLIB(IHBRDWRS) on volume: R1130A
000054 00000000 50+ DC A(0) ADDR
Could someone please help me in understanding where am i going wrong, in using DSECT.
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
You should be able to figure out the ASMA032E error all by your little self.
The ASMA035S error is more complicated. Basically, you have two methods.
The first one goes back to the BSAMRW method in your first thread. You have to store the address directly in the DECB before you run the READ macro as in my little example.
Unfortunately the READ/WRITE macros are sort of non-standard in how to specify and use a remote DECB. It comes about because the regular READ/WRITE macros build the DECB as part of the macro expansion and the addresses must be specified as a true address constant. In the first READ statement, when you specify MF=E you are telling the macro to prepare a remote DECB - that is a DECB that is not part of the macro - at address RMDECB. In the second READ statement you are saying prepare a DECB without the code to execute the read write function, and assign it label RMDECB.
The issue about inline data, as in the the DECB data area in the "standard" READ/WRITE macros versus the use of a remote DECB created using the MF=L specification of the READ/WRITE macros is more complex. Current programming practice discourages the use of data areas mixed in with code. In some cases there are performance issues. This was especially true with the first generation of z/Architecture mainframes. The situation was so smelly some customers told IBM to take first generation z/Architecture machines back rather than correct their own crummy programs! Not only that, but by definition, code using inline DECBs is not reenterable. So, learn how to use remote parameter lists.