👁 0
Q: How to handle variable length records?
Answer:
Use RECORD CONTAINS min TO max CHARACTERS clause in FD. Define RECORD-LENGTH field in the record. For VSAM, use RECORD VARYING IN SIZE. Access actual length via LENGTH OF or special register. Handle both fixed and variable portions appropriately.
👁 0
Q: How to handle CLOB in COBOL?
Answer:
Declare: 01 CLOB-VAR SQL TYPE IS CLOB(1M). Or use LOB locator: 01 CLOB-LOC SQL TYPE IS CLOB_LOCATOR. FREE LOCATOR releases. DBMS_LOB procedures for manipulation. Large CLOBs need special handling.
👁 0
Q: Explain SYMBOLIC CHARACTERS
Answer:
SPECIAL-NAMES. SYMBOLIC CHARACTERS NULL-CHAR IS 1. Assigns name to ordinal position in collating sequence. Position 1 is X'00' in EBCDIC. Use: MOVE NULL-CHAR TO field. Define non-printable characters readably.
👁 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.
👁 0
Q: What causes INVALID DATA SET NAME?
Answer:
Dataset name violates rules: 44 char max, qualifier 8 max, start with letter/national, periods separate qualifiers, no double periods, no special characters. Check spelling, length, valid characters.
👁 0
Q: What is LRECL=X?
Answer:
LRECL=X means system-determined length. Usually for RECFM=U or special files. System calculates based on BLKSIZE or file characteristics. Not common for normal datasets. Used with certain utilities.
👁 0
Q: Explain SPECIAL-NAMES paragraph
Answer:
SPECIAL-NAMES maps system names to COBOL names. DECIMAL-POINT IS COMMA for European notation. CURRENCY SIGN IS '$'. SYMBOLIC CHARACTERS name = value. ALPHABET for custom collating. CLASS for character groups.
👁 0
Q: What is CLASS condition?
Answer:
CLASS tests character content. IF field IS NUMERIC/ALPHABETIC/ALPHABETIC-LOWER/ALPHABETIC-UPPER. Custom classes in SPECIAL-NAMES: CLASS VOWELS IS 'A' 'E' 'I' 'O' 'U'. Then IF char IS VOWELS. Useful for validation.
👁 0
Q: What is LINEAR dataset?
Answer:
LINEAR VSAM is byte-addressable. No record structure. Used by DB2 tablespaces, system software. DEFINE CLUSTER LINEAR. Accessed via DIV (Data-in-Virtual) or memory mapping.
👁 0
Q: What is COLLATING SEQUENCE?
Answer:
PROGRAM COLLATING SEQUENCE IS sequence-name. Affects comparisons and SORT order. Define custom alphabet in SPECIAL-NAMES. Standard is NATIVE (EBCDIC). ASCII for ASCII order. STANDARD-1 for ASCII collating.
👁 0
Q: Explain ALPHABET clause
Answer:
ALPHABET defines custom collating sequence. ALPHABET MY-SEQ IS 'A' THRU 'Z' 'a' THRU 'z'. Or ALPHABET ASCII IS STANDARD-1. Use with COLLATING SEQUENCE. Affects string comparisons and SORT. Define in SPECIAL-NAMES.
👁 0
Q: What is TALLY special register?
Answer:
TALLY is predefined counter for EXAMINE (obsolete verb). Some code still references it. INSPECT replaced EXAMINE. Not recommended for new code. TALLY is global, can conflict. Define your own counters instead.
👁 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.