Ask the Expert

Running assembler code in two places

I have a program written in assembler and it does not contain any CICS command level calls. I assembled this program once only, then I linked it as two versions, one to run in batch mode and one to run under CICS.

How can this program determine whether it is running under CICS or batch? Can you suggest, in general terms, how I would approach the coding of this test? I want a single piece of program code which works correctly under both batch and CICS.

Requires Free Membership to View

I keep on getting this question -- and I keep on saying that this is not something of which I approve.

If you must have a chunk of assembler code that can be used in two places, structure it as a copybook and thense include it in two other programs -- one that can be compiled for CICS and the other for batch.

If you really want some control as to which code paths are used, code the source up as an assembler macro which can take a parm of BATCH=Y or N and so, emit the different code that way.

Robert Harris
CICS Technical Strategist -- CICS expert at

Editor's note: Do you agree with this expert's response? If you have more to share, post it in one of our .VO7aaqqaAFk.0@/search390>discussion forums.

This was first published in April 2003

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: