by Robert Sample » Mon Mar 23, 2015 6:32 am
1. In BUILD, you point R2 to the start of TABLE. You then use XREAD 0(R2),80 to wipe out the first 80 bytes of TABLE and replace them with the record you are reading instead of using XREAD CARD,80.
2. You XDUMP TABLE before you branch to the subroutine. You do not use XDUMP to check TABLE after the subprogram -- WHY?
3. Your BUILD subprogram does not initialize R5 yet uses it to increment through TABLE.
4. Your MAIN program does some really weird register stuff -- LA R9,1 followed by L R9,DIV for example (why use the LA if you just throw away that value immediately?) The same question for the next two lines of code with R10.
5, You pass 4 parameters to PRINT yet you use LM R2,R4 -- what about the 4th parameter?
6. Your PRINT subprogram uses R7 without initializing it, just as BUILD used R5.
7. PLINE is defined wrong -- it should be at least 75 bytes long (CL75 or 75CL1) to match your XPRNT. And carriage control comes FIRST in the line, so if you think the 75 bytes of spaces before PLINE will be used for your XPRNT, you are wrong; those 75 bytes are not being used by PRINT for anything.
I did NOT bring up my ASSIST documentation to check the syntax for your ASSIST commands (XREAD, XPRNT, end of file and so forth). They may be right but you need to double-check each of them.
Since you did not use CARD but the actual TABLE in your XREAD in BUILD, you have spaces for a batch of table entries. Spaces most likely get converted to 4444 in the XDECO and hence the ABEND in PRINT. The program is attempting to read up to 70 values in from cards, store them in a table, and print all the input values on a report. Whether or not this is what you want the program to do is another question; as written, the program is reading / storing / printing table entries (when the various problems and issues are corrected, of course).