JCL ⭐ Featured
👁 0

Q: What is the difference between COND and IF/THEN/ELSE in JCL?

Answer:

COND Parameter:

  • Tests return codes from previous steps
  • Bypasses step if condition is TRUE
  • Works opposite to programming logic!
  • COND=(4,LT) means: Skip if 4 < any previous RC

IF/THEN/ELSE:

  • More intuitive programming-like syntax
  • Executes steps when condition is TRUE
  • Supports AND, OR operators
  • Can check ABEND conditions

Example:

// Using COND (skip if RC < 4)
//STEP2 EXEC PGM=PROG2,COND=(4,LT)

// Using IF/THEN/ELSE
//    IF STEP1.RC = 0 THEN
//STEP2 EXEC PGM=PROG2
//    ELSE
//ERROR EXEC PGM=ERRPROC
//    ENDIF
JCL ⭐ Featured
👁 0

Q: What is the difference between PARM and SYSIN for passing parameters?

Answer:

PARM (EXEC statement):

  • Limited to 100 characters
  • Passed in memory to program
  • Accessed via LINKAGE SECTION
  • Good for small, simple parameters

SYSIN (DD statement):

  • No practical size limit
  • Read as a file by program
  • Can contain multiple records
  • Good for control cards, complex input
// PARM example
//STEP1 EXEC PGM=MYPROG,PARM='PARAM1,PARAM2'

// SYSIN example
//SYSIN DD *
CONTROL OPTION1
DATE=20231215
LIMIT=1000
/*
CICS ⭐ Featured
👁 0

Q: What is the purpose of COMMAREA in CICS?

Answer:

COMMAREA (Communication Area) is used to pass data between programs or between transactions in pseudo-conversational programming.

Uses:

  • Pass data between LINK/XCTL programs
  • Save data between pseudo-conversational transactions
  • Maximum size: 32KB

How it works:

  1. Calling program: COMMAREA option on LINK/XCTL/RETURN
  2. Called program: DFHCOMMAREA in LINKAGE SECTION
  3. Check EIBCALEN for length (0 = no COMMAREA)
* Calling program
EXEC CICS LINK
    PROGRAM('SUBPROG')
    COMMAREA(WS-DATA)
    LENGTH(100)
END-EXEC.

* Called program
LINKAGE SECTION.
01 DFHCOMMAREA PIC X(100).

IF EIBCALEN > 0
    MOVE DFHCOMMAREA TO WS-DATA
END-IF.
COBOL ⭐ Featured
👁 0

Q: Explain PROCEDURE DIVISION USING

Answer:
PROCEDURE DIVISION USING defines parameters for called program. Parameters match LINKAGE SECTION definitions. Order matches calling program's USING clause. Establishes addressability to passed data. BY REFERENCE/VALUE/CONTENT options inherited from CALL.
COBOL ⭐ Featured
👁 0

Q: What is GLOBAL clause?

Answer:
GLOBAL makes data available to nested programs. 01 WS-COUNTER PIC 9(5) GLOBAL. Nested programs can reference without passing as parameters. Use sparingly; explicit passing preferred. File definitions can also be GLOBAL.
COBOL ⭐ Featured
👁 0

Q: Explain EXTERNAL clause

Answer:
EXTERNAL allows data sharing between separately compiled programs. 01 WS-SHARED PIC X(100) EXTERNAL. All programs with same EXTERNAL name share same storage. Use for global data without passing parameters. Be careful with initialization.
VSAM ⭐ Featured
👁 0

Q: What causes file status 97?

Answer:
Status 97 indicates OPEN problem, often password or integrity. May be: dataset locked, open elsewhere without sharing, damaged dataset. Check SHAREOPTIONS, verify cluster status, recovery may be needed.
JCL ⭐ Featured
👁 0

Q: How to pass data between steps?

Answer:
Use DISP=PASS to pass datasets. Receiving step references same DSN. Or use symbolic parameters. GDG allows relative references (+1 created, 0 passed). Temporary datasets (&& prefix) auto-pass. SYSIN instream data copied to subsequent steps.
CICS ⭐ Featured
👁 0

Q: What is COMMAREA and how to use it?

Answer:
COMMAREA (Communication Area) passes data between programs and transactions. EXEC CICS LINK/XCTL COMMAREA(data) LENGTH(len). Receiving program has DFHCOMMAREA in LINKAGE. Max 32KB. Preserved across pseudo-conversational iterations.
JCL ⭐ Featured
👁 0

Q: Explain PARM parameter

Answer:
PARM passes data to program. EXEC PGM=PROG,PARM='value'. Max 100 characters. Program receives length prefix. PARM='abc,xyz' passes as one string. Program parses. Special chars need quotes. Alternative: SYSIN for larger data.
CICS ⭐ Featured
👁 0

Q: What is CHANNEL/CONTAINER?

Answer:
Channels group containers for data passing. EXEC CICS PUT CONTAINER(name) CHANNEL(chan) FROM(data). GET retrieves. Modern alternative to COMMAREA. No 32KB limit. Typed data support.
JCL ⭐ Featured
👁 0

Q: How to force uncataloged?

Answer:
VOL=SER=volume forces uncataloged access. DISP=(OLD,KEEP). System searches specified volume, not catalog. UNIT required. Bypasses catalog entirely. Useful for specific volume access. Security still applies.
CICS ⭐ Featured
👁 0

Q: How to use RETRIEVE command?

Answer:
RETRIEVE gets data passed via START. EXEC CICS RETRIEVE INTO(area) LENGTH(len). Data from START FROM parameter. Or RETRIEVE CHANNEL for containers. One retrieve per start.
VSAM ⭐ Featured
👁 0

Q: Explain SPEED/RECOVERY on REPRO?

Answer:
SPEED bypasses recovery info write. Faster but risky if failure. RECOVERY (default) safer but slower. Use SPEED for idempotent copies. RECOVERY for critical data.
COBOL
👁 0

Q: Explain CALL statement and parameters

Answer:
CALL invokes subprogram: CALL 'SUBPROG' USING param-1 param-2. BY REFERENCE (default) passes address. BY CONTENT passes copy. BY VALUE passes value (for C). ON EXCEPTION handles load failures. CANCEL releases memory.
COBOL
👁 0

Q: What is LINKAGE SECTION?

Answer:
LINKAGE SECTION defines parameters received from calling program. Items here have no memory until CALL provides addresses via USING clause. Address established at runtime. Used for both passed parameters and dynamically addressed data.
COBOL
👁 0

Q: What is RETURN-CODE register?

Answer:
RETURN-CODE sets program completion status. MOVE 0 TO RETURN-CODE (success). MOVE 8 TO RETURN-CODE (warning). Passed to caller/JCL. Check RETURN-CODE after CALL. LE uses CEE3STS for detailed status.
JCL
👁 0

Q: How does DISP parameter work?

Answer:
DISP=(status,normal-end,abnormal-end). Status: NEW/OLD/SHR/MOD. Normal-end: DELETE/KEEP/PASS/CATLG/UNCATLG. Abnormal-end: same options. Example: DISP=(NEW,CATLG,DELETE) creates new, catalogs if OK, deletes if abend. MOD appends or creates if not exists.
JCL
👁 0

Q: How to define temporary dataset?

Answer:
Temporary datasets: DSN=&&TEMP or omit DSN. Exist for job duration only. Not cataloged. Passed between steps with DISP=PASS. Automatically deleted at job end. Example: //WORK DD DSN=&&TEMP,UNIT=SYSDA,SPACE=(CYL,5)
JCL
👁 0

Q: Explain JES2 control cards

Answer:
JES2 cards start with /*. /*JOBPARM limits resources. /*ROUTE sends output. /*OUTPUT JESDS specifies JES output. /*PRIORITY sets priority. Process by JES2, not passed to job. Position after JOB card before first EXEC.
CICS
👁 0

Q: Explain START command

Answer:
START schedules transaction for later. EXEC CICS START TRANSID(trans) AFTER HOURS(1) FROM(data). INTERVAL or TIME for specific time. Data passed in channel/container or FROM/LENGTH. Background processing.
JCL
👁 0

Q: What is ACCTRG parameter?

Answer:
ACCT (accounting) provides billing information. On JOB card: ACCT=(account-number,additional-info). Installation-defined format. Passed to SMF for accounting records. May affect job processing priority.