S0C4 on a system call in a database procedure
search cancel

S0C4 on a system call in a database procedure

book

Article ID: 24957

calendar_today

Updated On:

Products

IDMS IDMS - Database

Issue/Introduction

A database procedure written in assembler fails with a S0C4 abend code when issuing an IDMS/DC system function call such as #LINK, #GETSTG or #GETIME.

Environment

Release: All supported releases.

Cause

Database procedures run in IDMS system mode. When running in system mode it is the calling program's responsibility to save and restore the registers. Failure to properly save and restore registers can result in S0C4 and other abends.

Resolution

All IDMS assembler macro calls can automatically generate code to save and restore registers by the use of the RGSV parameter. You can specify one register only or a range of registers to be saved. Normally you should specify RGSV=(R2-R8) to save all the registers you could possibly use in your program. For example, to code the #GETIME macro call and save all registers from 2 to 8, code the following:

#GETIME FORMAT=(BINFMT),RGSV=(R2-R8)