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
/*
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: Explain SHAREOPTIONS parameter

Answer:
SHAREOPTIONS(crossregion,crosssystem). Values: 1=exclusive, 2=read share/write exclusive, 3=full sharing, 4=full sharing no buffer refresh. SHAREOPTIONS(2 3) is common. Higher sharing needs application coordination.
VSAM ⭐ Featured
👁 0

Q: Explain FREESPACE parameter

Answer:
FREESPACE(cipct capct). CI percent free for inserts. CA percent free for splits. FREESPACE(20 10) leaves 20% CI, 10% CA free. More freespace reduces splits but uses more space. Tune based on activity.
VSAM ⭐ Featured
👁 0

Q: Explain REUSE parameter

Answer:
REUSE allows reloading without delete/define. DEFINE CLUSTER ... REUSE. OPEN OUTPUT resets to empty. Like scratch and rewrite. Good for temporary work files. Cannot be UNIQUE.
VSAM ⭐ Featured
👁 0

Q: What is file status 39?

Answer:
Status 39 is file attribute mismatch. JCL attributes don't match cluster. Check: RECFM, LRECL in JCL vs cluster. May need to omit DCB parameters. VSAM doesn't use standard DCB.
VSAM ⭐ Featured
👁 0

Q: Explain RECORDSIZE parameter

Answer:
RECORDSIZE(average maximum). For variable length records. Average used for space calculation. Maximum is hard limit. Fixed length: same average and max. Space formula uses average.
VSAM ⭐ Featured
👁 0

Q: Explain BUFFERSPACE parameter

Answer:
BUFFERSPACE sets total buffer memory. Alternative to BUFND/BUFNI. BUFFERSPACE(65536) allocates 64K for buffers. System divides between index and data. Simpler than separate settings.
JCL ⭐ Featured
👁 0

Q: Explain SPACE parameter options

Answer:
SPACE=(unit,(primary,secondary,directory)). Unit: TRK/CYL/block-size. Primary allocated first, secondary in 15 increments. Directory only for PDS. RLSE releases unused. CONTIG requires contiguous. Example: SPACE=(CYL,(10,5,20),RLSE)
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.
JCL ⭐ Featured
👁 0

Q: Explain DCB parameter

Answer:
DCB defines Data Control Block: RECFM (F/FB/V/VB/U), LRECL (record length), BLKSIZE (block size). DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920). Can inherit from existing dataset. LRECL required for new datasets. BLKSIZE=0 lets system optimize.
VSAM ⭐ Featured
👁 0

Q: Explain LOG parameter

Answer:
LOG(NONE/UNDO/ALL) specifies recovery logging. UNDO for backward recovery. ALL for forward and backward. NONE for no logging. Used with transactional systems. Most batch uses NONE.
JCL ⭐ Featured
👁 0

Q: What is REGION parameter?

Answer:
REGION specifies memory limit. REGION=0M means no limit (use system default). REGION=4M limits to 4MB. On JOB card affects all steps, on EXEC affects that step. Below 16M line: REGION=2048K. Modern systems often use REGION=0M.
JCL ⭐ Featured
👁 0

Q: What is symbolic parameter?

Answer:
Symbols are variables: SET symbol=value or &symbol on JOB/PROC. Reference: DSN=&HLQ..DATA. Resolved at job entry. EXEC proc,symbol=value overrides. SET statement defines. Symbols start with & and up to 8 characters.
JCL ⭐ Featured
👁 0

Q: Explain NOTIFY parameter

Answer:
NOTIFY=userid sends message when job completes. On JOB card. Multiple userids: NOTIFY=(USER1,USER2). Notifies success or failure. TSO users get message at terminal. Essential for batch monitoring. Commonly NOTIFY=&SYSUID for submitter.
JCL ⭐ Featured
👁 0

Q: How to concatenate datasets?

Answer:
Stack DD statements: //INPUT DD DSN=FILE1,DISP=SHR // DD DSN=FILE2,DISP=SHR. No DD name on continuation. Read consecutively as one file. Different LRECL needs LRECL on first DD or DCB parameter. Concatenation limit varies by system.
VSAM ⭐ Featured
👁 0

Q: How to handle status 44?

Answer:
Status 44 is boundary violation on sequential WRITE. Record too large for file definition. Check RECORDSIZE parameter. May need variable length definition. Truncation doesn't happen automatically.
JCL ⭐ Featured
👁 0

Q: What is COND CODE?

Answer:
Programs return condition/return code in register 15. COND parameter tests: COND=(4,LT) skips if 4 < any prior return code. Values 0-4095. Convention: 0=success, 4=warning, 8=error, 12+=severe. Used for job flow control.
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.
JCL ⭐ Featured
👁 0

Q: How to use SET statement?

Answer:
SET symbol=value assigns value. SET DATE=&LYYMMDD (system symbol). Multiple: SET A=1,B=2. Scope: job/proc. Override on EXEC. SET can reference other symbols. Evaluated at conversion time. Enables parameter files.
JCL ⭐ Featured
👁 0

Q: What is PRTY parameter?

Answer:
PRTY sets selection priority. PRTY=15 on JOB card. Values 0-15 (15 highest). Affects when job selected from queue. JES2 processes higher PRTY first within class. Different from PERFORM (execution priority).
JCL ⭐ Featured
👁 0

Q: What causes JCL ERROR?

Answer:
JCL ERROR means syntax error or invalid combination. Check: missing commas, unmatched quotes/parentheses, misspelled keywords, invalid parameter values. JES message indicates line and error. JESYSMSG has details.
JCL ⭐ Featured
👁 0

Q: How to use //IF statement?

Answer:
//IF (condition) THEN executes following steps if true. Conditions: RC, ABEND, ABENDCC, RUN, STEP.RC. Example: //IF (STEP1.RC = 0) THEN ... //ENDIF. Can nest. ELSE available. Clearer than COND parameter.
JCL ⭐ Featured
👁 0

Q: What causes S722 abend?

Answer:
S722 is output limit exceeded. Too many lines to SYSOUT. Check program loops causing excessive output. Increase output limit in installation parameters. Or reduce output volume. May need job card BYTES parameter.
JCL ⭐ Featured
👁 0

Q: Explain AVGREC parameter

Answer:
AVGREC specifies space in record units. AVGREC=U (units), K (thousands), M (millions). SPACE=(80,(100,10),,,ROUND) with AVGREC=K means 100,000 records. Easier than calculating tracks. System converts to tracks.
JCL ⭐ Featured
👁 0

Q: What is JESDS parameter?

Answer:
JESDS specifies JES dataset for OUTPUT. JESDS=ALL creates JESMSGLG, JESJCL, JESYSMSG. JESDS=LOG for JESMSGLG only. On OUTPUT statement. Controls system output generation. Used for output management.
JCL ⭐ Featured
👁 0

Q: Explain BUFNO parameter

Answer:
BUFNO sets number of I/O buffers. DCB=(BUFNO=5). More buffers improve sequential performance but use memory. System default often 5. VSAM uses different buffering (BUFNI, BUFND). Too many can waste memory.
CICS ⭐ Featured
👁 0

Q: What is LENGTH in commands?

Answer:
LENGTH specifies data size. LENGTH(ws-len). Required for variable data. Set before RECEIVE. Check after READ for actual length. FLENGTH for fullword. Some commands have defaults.
JCL ⭐ Featured
👁 0

Q: How to define VSAM in JCL?

Answer:
//DD DD DSN=VSAM.CLUSTER,DISP=SHR for existing. New cluster needs IDCAMS DEFINE CLUSTER. JCL references cluster, not data/index. AMP parameter for VSAM options: AMP=(BUFNI=8,BUFND=4). Cannot create VSAM with JCL alone.
JCL ⭐ Featured
👁 0

Q: What is FREE parameter?

Answer:
FREE specifies when to release allocation. FREE=END (default) at step end. FREE=CLOSE when file closed. FREE=CLOSE allows reuse within step. Reduces concurrent allocations. Helps resource-constrained systems.
JCL ⭐ Featured
👁 0

Q: What is PERFORM parameter?

Answer:
PERFORM assigns service class. PERFORM=n (1-999). JES/WLM determines resource allocation. Higher may get more resources. Installation dependent. Modern systems use WLM service classes instead.
JCL ⭐ Featured
👁 0

Q: What is PATHDISP parameter?

Answer:
PATHDISP=(normal,abnormal) for USS files. Options: KEEP, DELETE. PATHDISP=(KEEP,DELETE). Used with PATH parameter. Similar to DISP for MVS datasets. Controls USS file retention.
JCL ⭐ Featured
👁 0

Q: What is FILEDATA parameter?

Answer:
FILEDATA specifies DCB for NFS/USS. FILEDATA=TEXT or BINARY. TEXT handles line endings. BINARY transfers unchanged. On PATH DD statements. Affects how data converted between systems.
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.
JCL ⭐ Featured
👁 0

Q: What is DATACLAS parameter?

Answer:
DATACLAS assigns SMS data class. DATACLAS=classname. Defines DCB attributes, space, data type. ACS routines may assign automatically. Overrides explicit DCB. Simplifies JCL. Installation-defined classes.
JCL ⭐ Featured
👁 0

Q: What is SEGMENT parameter?

Answer:
SEGMENT limits output lines per dataset. On OUTPUT statement. SEGMENT=nnn pages per segment. JES creates multiple output datasets. Helps with huge print files. Easier to handle smaller pieces.
JCL ⭐ Featured
👁 0

Q: Explain REFDD parameter?

Answer:
REFDD references DD for attributes. DCB=*.STEP.DD or REFDD=ddname. Copies DCB info. Similar to VOL=REF. Useful for consistent attributes. Referenced DD must be allocated first.
JCL ⭐ Featured
👁 0

Q: What is RLSE subparameter?

Answer:
RLSE releases unused space at close. SPACE=(CYL,(10,5),RLSE). Returns unused secondary allocations. Good practice for new datasets. Saves disk space. May cause allocation issues if reextended.
JCL ⭐ Featured
👁 0

Q: Explain EROPT parameter?

Answer:
EROPT specifies error handling. DCB=(EROPT=ABE/ACC/SKP). ABE=abend on error, ACC=accept and continue, SKP=skip block. For tape I/O errors. Program may handle differently. Default is ABE.
CICS ⭐ Featured
👁 0

Q: Explain CICS DB2 connection

Answer:
CICS connects to DB2 via thread. EXEC SQL in CICS program. RCT (Resource Control Table) defines. Thread pool for efficiency. DB2 subsystem parameter.
DB2
👁 0

Q: What is stored procedure?

Answer:
Stored procedure is saved SQL code. CREATE PROCEDURE name(params) BEGIN SQL statements END. CALL name(values) executes. Can have IN/OUT/INOUT parameters. Reduces network traffic. Logic in database. Security benefits.
DB2
👁 0

Q: How to prevent SQL injection?

Answer:
Use parameter markers (?), not concatenation. PREPARE stmt FROM 'SELECT * FROM t WHERE c = ?'. EXECUTE stmt USING :hostvar. Never build SQL with user input directly. Validate input. Use static SQL when possible.
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.
DB2
👁 0

Q: What is zparm?

Answer:
ZPARM (DSNZPARMs) are DB2 installation parameters. Control system behavior, limits, defaults. DSNZPARM module loaded at startup. Changes need restart usually. Critical for performance and security tuning.
COBOL
👁 0

Q: Explain ENTRY statement

Answer:
ENTRY creates alternate entry point in subprogram. ENTRY 'ALTNAME' USING params. Called program appears under different name. Useful for multiple functions in one load module. Each ENTRY has own parameters. Not standard-use carefully.
VSAM
👁 0

Q: What is ERASE parameter?

Answer:
ERASE overwrites data on delete. DELETE CLUSTER ERASE. Security feature - data unrecoverable. Without ERASE, space released but data remains. Use for sensitive data.
VSAM
👁 0

Q: How to handle multi-string access?

Answer:
STRNO parameter defines concurrent requests. More strings for high-activity files. Costs memory per string. JCL: AMP='STRNO=5'. Default usually 1. Batch usually needs 1-2.
VSAM
👁 0

Q: What is DEFINE MODEL?

Answer:
MODEL copies attributes from existing cluster. DEFINE CLUSTER(NAME(new) MODEL(existing)). Only copies definition, not data. Useful for creating similar clusters. Can override specific parameters.
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: What is TYPRUN parameter?

Answer:
TYPRUN options: SCAN (syntax check, no execution), HOLD (submit but hold), COPY (copy JCL to SYSOUT), JCLHOLD (hold with JCL). TYPRUN=SCAN validates JCL without running. Useful for testing complex JCL before production.
VSAM
👁 0

Q: What is CATALOG vs CATACB?

Answer:
CATALOG parameter specifies which catalog to use. CATALOG(catalog.name) on DEFINE. CATACB no longer used. Modern systems use aliases to route to correct catalog.
JCL
👁 0

Q: What causes S322 abend?

Answer:
S322 is job/step time exceeded. Check TIME parameter on JOB/EXEC. Causes: infinite loop, too much data, insufficient time allocated. Fix: increase TIME, optimize program, check data volumes. TIME=1440 is no limit (24 hours).
JCL
👁 0

Q: What is MSGLEVEL parameter?

Answer:
MSGLEVEL=(statements,messages). Statements: 0=JOB only, 1=all JCL, 2=input JCL. Messages: 0=completion only, 1=all including allocation. MSGLEVEL=(1,1) shows everything. MSGLEVEL=(0,0) minimal output. Affects JESMSGLG.
JCL
👁 0

Q: Explain referback DD

Answer:
Referback references earlier DD: DSN=*.STEP1.DDNAME or DSN=*.DDNAME (same step). Copies DSN and DISP. Can override other parameters. VOL=REF=*.STEP1.DD copies volume. Useful for chained processing.
JCL
👁 0

Q: Explain RESTART parameter

Answer:
RESTART=stepname restarts job at specified step. RESTART=(stepname,checkid) for checkpointed restart. Use after abend to continue from failure point. Prior steps skipped. Data must be recoverable or recreatable.
JCL
👁 0

Q: What is CLASS parameter?

Answer:
CLASS assigns job to execution class. CLASS=A on JOB card. Initiators start jobs by class. Determines execution priority, resources. Installations define class characteristics. Multiple classes: CLASS=AB (not common). JES2/JES3 interpret differently.
JCL
👁 0

Q: What is UNIT parameter?

Answer:
UNIT specifies device type. UNIT=SYSDA (direct access), UNIT=TAPE, UNIT=3390. UNIT=AFF=ddname shares device. UNIT=(SYSDA,2) allocates 2 volumes. SMS may override. UNIT=VIO for virtual I/O (memory only).
JCL
👁 0

Q: What is VOL parameter?

Answer:
VOL specifies volume. VOL=SER=PACK01 specific volume. VOL=REF=*.STEP.DD copies volume from previous. VOL=(,RETAIN) keeps volume mounted. VOL=(,,,5) allows 5 volumes. SER overrides SMS placement. Use cautiously.
JCL
👁 0

Q: Explain LIKE parameter

Answer:
LIKE copies DCB attributes from existing dataset. DCB=*.STEP1.DD or LIKE=catalog.dataset. Simplifies JCL. Model dataset must exist or be allocated earlier. Override specific attributes: DCB=(LIKE=...,LRECL=100).
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.
JCL
👁 0

Q: What is KEYLEN parameter?

Answer:
KEYLEN specifies key length for new dataset. DCB parameter for VSAM-like. Or VSAM DEFINE CLUSTER KEYS(length offset). Length 1-255. Required for indexed organization. Offset from 0 or 1 depending on context.
JCL
👁 0

Q: Explain LABEL parameter

Answer:
LABEL=(n,type) specifies tape label info. n=file sequence number. Type: SL=standard, NL=no labels, SUL=standard user. LABEL=(2,SL) is second file on standard label tape. EXPDT/RETPD for retention.
JCL
👁 0

Q: What is RETPD parameter?

Answer:
RETPD=nnn specifies retention days. Cannot delete until expired. EXPDT=yyddd for specific date. EXPDT=99365 or RETPD=9999 for permanent. Security software may override. Affects tape and disk datasets.
JCL
👁 0

Q: What is SPIN parameter?

Answer:
SPIN=UNALLOC releases output immediately on step/job end. SPIN=(UNALLOC,step) at step end. Without SPIN, output held until job completes. Allows viewing long job output early. On DD SYSOUT statement.
JCL
👁 0

Q: What is AMP parameter?

Answer:
AMP specifies VSAM buffer parameters. AMP='BUFNI=8,BUFND=4' for index/data buffers. AMP='AMORG' for VSAM organization. OPTCD for options. Overrides VSAM cluster definitions for this run. Affects performance.
JCL
👁 0

Q: Explain DEST parameter?

Answer:
DEST routes output. DEST=nodeid.userid sends to remote. DEST=LOCAL for local printer. On OUTPUT statement or SYSOUT. JESDS respects DEST. Can be printer name or user. Network delivery support.
JCL
👁 0

Q: How to override PROC DD?

Answer:
//procstep.ddname DD overrides. //MYSTEP.SYSOUT DD SYSOUT=H changes SYSOUT class. Can add parameters or replace entirely. Add new DD: //MYSTEP.NEWDD DD DSN=... Position after EXEC procname.
JCL
👁 0

Q: Explain EXPDT parameter?

Answer:
EXPDT=yyddd or EXPDT=yyyyddd expiration date. After this date, dataset can be deleted. EXPDT=99365 effectively permanent (1999 or 2099). RETPD alternative. Security software may enforce or override.
JCL
👁 0

Q: Explain STORCLAS parameter?

Answer:
STORCLAS assigns SMS storage class. STORCLAS=classname. Determines placement, management, backup. ACS routines may assign. Defines performance characteristics. Installation-defined classes.
JCL
👁 0

Q: What is MGMTCLAS parameter?

Answer:
MGMTCLAS assigns SMS management class. Controls migration, backup, retention. MGMTCLAS=classname. Defines data lifecycle. HSM uses management class. Installation-defined policies.
JCL
👁 0

Q: How to use MODIFY parameter?

Answer:
MODIFY references FCB image. MODIFY=(fcb,trc) on OUTPUT. FCB controls forms. TRC is table reference character. For print formatting. Installation-defined FCBs. Used with special forms.
VSAM
👁 0

Q: What is CATALOG parameter in DEFINE?

Answer:
CATALOG(catalog.name) specifies which catalog to use. Without it, uses alias routing. Important for multi-catalog environments. Modern systems often rely on alias. Explicit better for clarity.