DB2 ⭐ Featured
👁 0

Q: What is ROW_NUMBER()?

Answer:
ROW_NUMBER() assigns sequential numbers. ROW_NUMBER() OVER (ORDER BY col). Numbers restart per PARTITION BY group. Use for paging, deduplication (keep first), ranking. Result is numeric.
COBOL ⭐ Featured
👁 0

Q: What is the difference between SECTION and PARAGRAPH in COBOL?

Answer:

SECTION:

  • Contains one or more paragraphs
  • Ends with next SECTION or end of program
  • Used for logical grouping
  • Can be performed as a unit

PARAGRAPH:

  • Basic unit of code
  • Named block of statements
  • Ends at next paragraph name or SECTION

PERFORM SECTION-NAME executes all paragraphs in the section.

PERFORM PARA-NAME executes only that paragraph.

COBOL ⭐ Featured
👁 0

Q: Explain SECTION vs PARAGRAPH

Answer:
SECTION groups related paragraphs, terminated by next SECTION or end of program. PARAGRAPH is a named block of code, terminated by next paragraph/section. PERFORM SECTION executes all paragraphs within. SECTION needed for segmentation, PARAGRAPH for simple procedures.
COBOL ⭐ Featured
👁 0

Q: What is RENAMES clause?

Answer:
RENAMES (66-level) creates alternative groupings of elementary items. 01 REC. 05 FIELD-A PIC X(5). 05 FIELD-B PIC X(5). 05 FIELD-C PIC X(5). 66 FIELDS-AB RENAMES FIELD-A THRU FIELD-B. Provides different data views without memory overhead.
DB2 ⭐ Featured
👁 0

Q: Explain database design normalization

Answer:
1NF: atomic values, no repeating groups. 2NF: 1NF + no partial dependencies. 3NF: 2NF + no transitive dependencies. BCNF: stricter 3NF. Higher forms reduce redundancy. Denormalize for performance. Balance is key.
DB2 ⭐ Featured
👁 0

Q: What is tablespace?

Answer:
Tablespace is storage container for tables. CREATE TABLESPACE name IN database USING STOGROUP. Contains one or more tables. Segmented/universal tablespace types. Management at tablespace level (REORG, COPY, RECOVER).
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 CI and CA in VSAM?

Answer:
CI (Control Interval) is I/O unit, like block. Contains records, free space, control info. CA (Control Area) is group of CIs. CISIZE affects performance. CI split when full. CA split more expensive.
COBOL ⭐ Featured
👁 0

Q: What is USE BEFORE REPORTING?

Answer:
In Report Writer, USE BEFORE REPORTING procedure runs before printing. USE BEFORE REPORTING report-group-name. Allows dynamic modification of report data. Can suppress or modify lines based on runtime conditions.
JCL ⭐ Featured
👁 0

Q: Explain generation data groups

Answer:
GDG maintains versions. Base defined with IDCAMS: DEFINE GDG NAME(base) LIMIT(10) SCRATCH. Reference: base(+1) new, base(0) current, base(-1) previous. LIMIT controls kept generations. NOEMPTY/EMPTY for empty condition.
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 allocate SYSDA?

Answer:
UNIT=SYSDA for disk. Generic device group. Installation defines SYSDA contents. Usually includes all available disk. SMS may direct allocation. UNIT=3390 for specific device type. SYSDA preferred for portability.
DB2
👁 0

Q: How to use window functions?

Answer:
ROW_NUMBER() OVER (PARTITION BY col ORDER BY col2). RANK, DENSE_RANK for rankings. SUM/AVG/COUNT OVER for running totals. PARTITION BY groups within result. ORDER BY within partition. Powerful analytics.
DB2
👁 0

Q: What is data sharing?

Answer:
Data sharing allows multiple DB2s to access same data. Group of subsystems share data. Uses Coupling Facility for coordination. Provides availability, scalability. Complex but powerful for high availability.
DB2
👁 0

Q: Explain storage group

Answer:
Storage group defines volumes for data. CREATE STOGROUP name VOLUMES(vol1, vol2). Tablespaces assigned to stogroups. DB2 manages space within. PRIQTY/SECQTY control allocation. Foundation of storage management.
COBOL
👁 0

Q: What is SYNCHRONIZED clause?

Answer:
SYNCHRONIZED aligns binary items on natural boundaries for efficient access. 01 WS-GROUP. 05 WS-CHAR PIC X. 05 WS-BINARY PIC S9(8) COMP SYNC. Adds slack bytes as needed. Can waste space but improves performance. RIGHT/LEFT options available.
COBOL
👁 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.
COBOL
👁 0

Q: How to define group level items?

Answer:
Group items contain subordinate items. 01 WS-DATE. 05 WS-YEAR PIC 9(4). 05 WS-MONTH PIC 99. 05 WS-DAY PIC 99. Group is alphanumeric regardless of contents. MOVE WS-DATE moves all 8 bytes. Reference individual or group.
COBOL
👁 0

Q: How to use SUBTRACT CORRESPONDING?

Answer:
SUBTRACT CORRESPONDING subtracts matching fields. SUBTRACT CORR group-1 FROM group-2. Each matching numeric field in group-2 decreased by corresponding group-1 value. Use ROUNDED and SIZE ERROR options. Limited to numeric fields.
COBOL
👁 0

Q: Explain FUNCTION LENGTH

Answer:
FUNCTION LENGTH returns byte count. FUNCTION LENGTH(field-name). For group items, includes all subordinates. For variable OCCURS, actual current length. Use in COMPUTE, MOVE, comparisons. Often used with STRING pointer initialization.
CICS
👁 0

Q: What is CEDA?

Answer:
CEDA defines CICS resources online. CEDA DEFINE PROGRAM(pgm) GROUP(grp). Resources: TRANSACTION, PROGRAM, FILE, etc. CEDA INSTALL activates. CEDA VIEW displays. RDO (Resource Definition Online).
JCL
👁 0

Q: What is CNTL statement?

Answer:
CNTL groups control statements. //name CNTL establishes scope. //name ENDCNTL ends it. Used with OUTPUT or other complex statements. Provides modularity. Can be referenced by name from multiple DDs.
DB2
👁 0

Q: What is GROUP BY clause?

Answer:
GROUP BY aggregates rows. SELECT col, COUNT(*) FROM t GROUP BY col. All non-aggregate SELECT columns must be in GROUP BY. HAVING filters groups (vs WHERE filters rows). GROUP BY ROLLUP/CUBE for subtotals.