Thursday, December 8, 2011

COBOL: Issue when Main program with AMODE=31 and Sub program with AMODE=24


Scenario
Main program attributes AMODE=31,RMODE=ANY(Record structure in FD, working storage section will be allocated above the line)
Sub program attributes AMODE=24,RMODE=24.

Issue
When we pass any parameter (can be a field from record structure, or working storage section field) to the sub program from main program, the job will abend.

Solution 
To avoid abend, Main program should be compiled with DATA(24) compiler option. This compiler option forces record structure fields, and working storage section fields to be allocated below the line.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.