COBOL S0C7 ⭐ Featured
👁 0

Q: How do I fix S0C7 Data Exception ABEND?

Answer:

S0C7 occurs when the program tries to perform arithmetic on non-numeric data.

Common Causes:

  1. Uninitialized numeric fields (contains spaces/garbage)
  2. Moving alphanumeric data to numeric field
  3. Reading file with wrong record layout
  4. Array subscript accessing wrong memory

How to Fix:

  1. Initialize all numeric fields to ZEROS
  2. Validate input before arithmetic
  3. Check file layouts match
  4. Use DISPLAY to debug field contents
* Always initialize
INITIALIZE WS-RECORD.
MOVE ZEROS TO WS-AMOUNT.

* Validate before use
IF WS-INPUT IS NUMERIC
    COMPUTE WS-RESULT = WS-INPUT * 2
END-IF.
CICS ⭐ Featured
👁 0

Q: What is pseudo-conversational programming in CICS?

Answer:

Pseudo-conversational programming is a technique where the program ends between user interactions, freeing system resources.

How it works:

  1. Program sends screen to user and ends (RETURN TRANSID)
  2. User enters data and presses Enter
  3. CICS starts a new task with same program
  4. Program retrieves saved data from COMMAREA
  5. Process continues

Benefits:

  • Efficient resource usage
  • Better response times
  • More concurrent users

Implementation:

* End task, wait for user
EXEC CICS RETURN
    TRANSID('MENU')
    COMMAREA(WS-COMM)
    LENGTH(100)
END-EXEC.

* On return, check EIBCALEN
IF EIBCALEN = 0
    PERFORM FIRST-TIME
ELSE
    MOVE DFHCOMMAREA TO WS-COMM
    PERFORM PROCESS-INPUT
END-IF.
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
/*
DB2 ⭐ Featured
👁 0

Q: What is UNLOAD utility?

Answer:
UNLOAD extracts data to sequential file. UNLOAD FROM TABLE name. Output format matches LOAD input. Used for data migration, backup, extract. Can include WHERE clause for filtering.
COBOL ⭐ Featured
👁 0

Q: What causes S0C7 abend and how to fix it?

Answer:
S0C7 (Data Exception) occurs when non-numeric data is used in numeric operations. Common causes: uninitialized fields, incorrect data from files, wrong REDEFINES. Fix by: initializing variables, validating input data, using INSPECT/NUMVAL functions, checking file data quality.
COBOL ⭐ Featured
👁 0

Q: Explain STRING and UNSTRING operations

Answer:
STRING concatenates multiple fields into one: STRING field-1 DELIMITED BY SPACE field-2 INTO output-field. UNSTRING splits one field into multiple: UNSTRING input-field DELIMITED BY ',' INTO field-1 field-2. Both support POINTER for position tracking and OVERFLOW handling.
COBOL ⭐ Featured
👁 0

Q: What is MOVE CORRESPONDING?

Answer:
MOVE CORRESPONDING moves all fields with matching names between groups. MOVE CORR INPUT-REC TO OUTPUT-REC. Only moves if names match exactly. Moves all matches, not just first. Useful for record transformations. Debug carefully-silent partial moves.
VSAM ⭐ Featured
👁 0

Q: What is file status 92?

Answer:
Status 92 is logic error. Conflicting operation for file state. Examples: READ before OPEN, WRITE to INPUT file, wrong ACCESS MODE for operation. Check program logic carefully.
JCL ⭐ Featured
👁 0

Q: What causes S0C7 in batch?

Answer:
S0C7 is data exception - non-numeric in numeric field. Check: input file data quality, initialize variables, correct REDEFINES, field alignment. Use OFFSET in dump to find statement. LE CEEDUMP shows data values. Common with new programs.
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.
JCL ⭐ Featured
👁 0

Q: What is IEBGENER utility?

Answer:
IEBGENER copies sequential datasets. SYSUT1=input, SYSUT2=output, SYSIN=control. Simple copy needs only SYSUT1/SYSUT2/SYSIN DD DUMMY. Can reformat, generate, edit records with SYSIN statements. Being replaced by ICEGENER.
CICS ⭐ Featured
👁 0

Q: What is pseudo-conversational programming?

Answer:
Pseudo-conversational ends task after sending screen, restarts on input. EXEC CICS RETURN TRANSID(trans) COMMAREA(data). Saves resources - no task waiting for user. Must restore state from COMMAREA. Standard CICS approach.
CICS ⭐ Featured
👁 0

Q: What is BMS?

Answer:
BMS (Basic Mapping Support) handles screen I/O. Map defines screen layout. DFHMSD macro creates mapset. SEND MAP displays screen. RECEIVE MAP gets input. Symbolic map in COBOL copybook. Physical map in load library.
CICS ⭐ Featured
👁 0

Q: What is IMMEDIATE option?

Answer:
IMMEDIATE on RETURN returns without COMMAREA. EXEC CICS RETURN IMMEDIATE. Next input starts fresh - no continuation. Use when pseudo-conv not needed.
JCL ⭐ Featured
👁 0

Q: What is SYSIN DD *?

Answer:
SYSIN DD * starts instream data. Data follows until /*. Program reads via SYSIN DD. Common for utility control statements. DD DATA,DLM=xx if data contains /*. SYSIN DD DUMMY for no input.
JCL ⭐ Featured
👁 0

Q: Explain NULLFILE keyword?

Answer:
NULLFILE is alternate for DUMMY. //DD DD NULLFILE. Discards output, provides EOF for input. DSN=NULLFILE equivalent. No actual dataset. Useful for testing without actual files.
JCL ⭐ Featured
👁 0

Q: How to reference PDS member?

Answer:
DSN=PDS.NAME(MEMBER). Direct member reference. DISP must allow access. For input, member must exist. For output, overwrites or creates. IEBCOPY for multiple members. Member name 1-8 characters.
CICS ⭐ Featured
👁 0

Q: Explain symbolic map structure

Answer:
Symbolic map copybook. Field name with L (length), F (flag), A (attribute), I (input), O (output). Set -1 in length for cursor. Check flag for modified. Program data area.
DB2
👁 0

Q: Explain LOAD utility

Answer:
LOAD inserts large data volumes. LOAD DATA INTO TABLE name. Options: REPLACE, RESUME, LOG NO. Input is SYSREC dataset. LOAD faster than INSERT. Puts tablespace in COPY PENDING after LOG NO.
COBOL
👁 0

Q: What is FILE STATUS and common codes?

Answer:
FILE STATUS is a 2-byte field capturing I/O operation results. 00=success, 10=end-of-file, 22=duplicate key, 23=record not found, 35=file not found, 39=file attribute mismatch, 41=file already open, 47=not opened input. Essential for error handling.
COBOL
👁 0

Q: How does ACCEPT and DISPLAY work?

Answer:
ACCEPT reads from console/system: ACCEPT WS-DATE FROM DATE, ACCEPT WS-INPUT FROM CONSOLE. DISPLAY writes to console: DISPLAY 'Message' WS-FIELD. UPON clause specifies destination. Limited in batch; mainly for debugging or simple interaction.
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: What is SORT and MERGE in COBOL?

Answer:
SORT orders records: SORT SORT-FILE ON ASCENDING KEY-FIELD USING INPUT-FILE GIVING OUTPUT-FILE. INPUT/OUTPUT PROCEDURE allows processing during sort. MERGE combines pre-sorted files: MERGE SORT-FILE ON KEY USING FILE-1 FILE-2 GIVING OUTPUT-FILE.
VSAM
👁 0

Q: How to read VSAM sequentially?

Answer:
OPEN INPUT file. START if positioning needed. READ NEXT repeatedly until status 10 (end of file). CLOSE file. START optional - defaults to beginning. READ NEXT gets records in key sequence for KSDS.
COBOL
👁 0

Q: What is OPEN mode options?

Answer:
OPEN INPUT for read, OUTPUT for write (creates), I-O for read/update, EXTEND for append. Multiple files per OPEN. OPEN OUTPUT deletes existing file! EXTEND preserves and adds. File must be closed before reopening in different mode.
COBOL
👁 0

Q: What is OPTIONAL file clause?

Answer:
OPTIONAL allows missing files: SELECT OPTIONAL input-file. OPEN succeeds even if file absent. READ immediately gets end-of-file. Useful for conditional processing. FILE STATUS 35 if accessed without OPTIONAL.
VSAM
👁 0

Q: What is file status 47?

Answer:
Status 47 is READ attempted but file not open input. OPEN mode doesn't match operation. Must OPEN INPUT or I-O for READ. Check file OPEN statement and mode.
JCL
👁 0

Q: Explain DD DUMMY statement

Answer:
DD DUMMY discards output/provides EOF for input. No I/O actually performed. DUMMY, DSN=NULLFILE equivalent. Use to skip optional outputs or provide empty input. Program sees immediate EOF on read. Writes succeed but discarded.
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: How does IEBCOPY work?

Answer:
IEBCOPY copies/merges PDS members. SYSUT1=input PDS, SYSUT2=output PDS. SYSIN: COPY OUTDD=SYSUT2,INDD=SYSUT1 copies all. SELECT MEMBER=name for specific members. REPLACE option overwrites existing. Can compress PDS.
JCL
👁 0

Q: Explain DFSORT utility

Answer:
DFSORT sorts/merges files. SYSIN has SORT FIELDS=(1,10,CH,A). SORTIN=input, SORTOUT=output. Options: INCLUDE/OMIT for filtering, OUTREC/INREC for reformatting, SUM for summarization. ICETOOL provides extended functions.
CICS
👁 0

Q: What is RECEIVE MAP?

Answer:
EXEC CICS RECEIVE MAP(name) MAPSET(mapset) INTO(symbolic-map). Gets terminal input. Modified fields only (MDT). Check EIBAID for key pressed. MAPFAIL if no data. Symbolic map populated with input.
JCL
👁 0

Q: How does MERGE work?

Answer:
DFSORT MERGE combines pre-sorted files. SORTIN01, SORTIN02, etc. inputs. MERGE FIELDS=(1,10,CH,A). Files must be sorted on merge key. Output one sorted file. Preserves input order for equal keys.
CICS
👁 0

Q: What is BIF DEEDIT?

Answer:
BIF DEEDIT removes edit characters. EXEC CICS BIF DEEDIT FIELD(data) LENGTH(len). Converts edited numeric to raw. Removes $, commas, etc. Useful for BMS numeric input.
DB2
👁 0

Q: What is SPUFI?

Answer:
SPUFI (SQL Processing Using File Input) is TSO tool for interactive SQL. Input dataset with SQL statements. Output shows results. Good for testing queries, DDL, quick data checks. Not for production processing.