Wednesday, April 25, 2018

PL/1 DB2 Program ABEND S0C1

Technologies Used:
  • PL/1 3.8
  • DB2
  • z/OS
Caused By:
An 0C1 ABEND is caused by an invalid instruction.

Normally, 0C1 is caused by writing to an unopened file. But this was strange because there were no files that had to be written and the only I/O was to DB2.

A few discussion with our technical guy pointed to PL/1 compiler not actually generating data areas of variables if they are not being used. For some reason, this messes up the program during execution. I was led on a wrong path because someone suggested that I had to initialize all variables in the PL/1 program. I thought that this was not solution because if it was, then a lot of people would have complained.

Another option was to look at the parameters during the compile. I added the INIT parameters during the compile and still no success. Tried the STATIC(FULL) option and still no success.

Left without any other option, I stripped off all variables and ran the program only with the SQL statement. The program executed the SQL statement without any problem. I then slowly added a bunch of variables until I hit the one that caused the ABEND.

Quite a pain to do, but was finally able to isolate the problem and more importantly, fix it.

No comments:

Post a Comment

Total Pageviews