COBOL
Concatenate multiple fields using STRING statement....
string
concatenate
delimited
COBOL
Use INSPECT to count and replace characters....
inspect
tallying
replacing
converting
COBOL
Explain and use computational data types COMP, COMP-1, COMP-2, COMP-3....
comp
comp-3
binary
packed-decimal
COBOL
Format numbers for display using edited PIC clauses: Z, *, $, comma, period....
edited-pic
formatting
display
COBOL
Use REDEFINES to interpret same storage in multiple ways....
redefines
storage
data-types
COBOL
Calculate simple interest: SI = (P * R * T) / 100...
interest
compute
financial
COBOL
Handle decimal precision with ROUNDED and overflow with ON SIZE ERROR....
rounded
size-error
overflow
precision
COBOL
Calculate progressive tax: 0-10000: 0%, 10001-30000: 10%, 30001-50000: 20%, Above 50000: 30%....
tax
brackets
progressive
calculation
COBOL
Accept a year and determine if it is a leap year....
leap-year
divide
remainder
COBOL
Use EVALUATE for multiple condition checking (like switch-case)....
evaluate
switch
case
conditions
COBOL
Use 88-level condition names for readable conditions....
88-level
condition-name
readable
COBOL
Combine conditions using AND, OR, NOT operators....
and
or
not
complex-conditions
COBOL
Calculate factorial of a number (n! = 1*2*3*...*n)....
factorial
loop
multiply
COBOL
Use PERFORM VARYING for counter-controlled loops....
perform
varying
for-loop
nested
COBOL
Execute a range of paragraphs using PERFORM THRU....
perform
thru
paragraph
sequence
COBOL
Generate all prime numbers up to N....
prime
algorithm
loop
divisibility
COBOL
Accept a string and display it reversed....
string
reverse
reference-modification
COBOL
Count the number of vowels in a given string....
string
inspect
vowels
COBOL
Accept 10-digit phone and format as (XXX) XXX-XXXX. Input: 1234567890 -> (123) 456-7890...
string
formatting
reference-modification
COBOL
Count the number of words in a sentence. Input: "HELLO WORLD COBOL" -> 3 words...
string
word-count
algorithm
COBOL
Validate if email has proper format: contains @ and . after @....
email
validation
string
COBOL
Check if a string is a palindrome (same forward and backward)....
palindrome
string
algorithm
COBOL
Create and work with a two-dimensional table....
table
2d
matrix
nested-occurs
COBOL
Search tables using linear SEARCH and binary SEARCH ALL....
search
search-all
binary-search
indexed
COBOL
Create variable-length table using OCCURS DEPENDING ON....
variable-length
depending-on
dynamic
COBOL
Use COPY to include copybook members....
copy
copybook
include
replacing
COBOL
Call a subprogram and pass parameters....
call
subprogram
linkage
using
JCL
Write JCL that creates a new sequential dataset....
dd
output
dcb
JCL
Write JCL to sort a file by employee ID (positions 1-5)....
sort
utility
JCL
Write JCL that runs STEP2 only if STEP1 returns RC=0, and STEP3 runs if either step failed....
cond
return-code
conditional
JCL
Write IDCAMS to delete a VSAM file if it exists, then define a new KSDS....
idcams
vsam
ksds
define
JCL
Sort employee file, include only active employees (status=A in pos 50), sort by department and name....
sort
include
filter
JCL
Explain all common DD statement parameters....
dd
dsn
disp
space
JCL
Use JOBLIB and STEPLIB for program libraries....
joblib
steplib
loadlib
concatenation
JCL
Use JCLLIB and INCLUDE for procedure libraries....
jcllib
include
modular
library
COBOL
Track deposits and withdrawals, maintain balance, prevent overdraft....
banking
transaction
validation
COBOL
Validate credit card number using Luhn algorithm. Check: 16 digits, valid checksum, identify card type (Visa/Master/Amex)....
validation
luhn
credit-card
algorithm
COBOL
Calculate: days between two dates, find day of week for any date....
date
functions
calculation
COBOL
Calculate Equated Monthly Installment (EMI) for a loan....
loan
emi
finance
amortization
COBOL
Why does this show 0 instead of 150?
01 WS-A PIC 99 VALUE 15.
01 WS-B PIC 99 VALUE 10.
01 WS-C PIC 99.
MULTIPLY WS-A BY WS...
debugging
truncation
pic
COBOL
This code causes S0C7 (data exception). Find the bug:
01 WS-NUM PIC 9(5).
MOVE SPACES TO WS-NUM.
ADD 1 TO WS-NUM....
debugging
s0c7
abend
COBOL
This code causes S0C4. Find the bug:
01 WS-TABLE.
05 WS-ITEM PIC X(10) OCCURS 10 TIMES.
01 WS-IDX PIC 99 VALUE 0.
PERFO...
debugging
s0c4
subscript
table
COBOL
File READ fails silently. Find why:
READ INPUT-FILE INTO WS-RECORD.
DISPLAY WS-RECORD....
debugging
file-status
error-handling
COBOL
This code runs forever. Find and fix the bug:
PERFORM UNTIL WS-I > 10
DISPLAY WS-I
END-PERFORM....
debugging
infinite-loop
perform
COBOL
Negative number displays wrong:
01 WS-BAL PIC 9(5) VALUE 0.
SUBTRACT 100 FROM WS-BAL....
debugging
sign
negative
COBOL
STRING produces truncated result:
01 WS-RESULT PIC X(10).
STRING "HELLO" " " "WORLD" INTO WS-RESULT....
debugging
string
overflow
COBOL
SEARCH never finds existing item:
SET IDX TO 1.
SEARCH WS-TABLE AT END DISPLAY "NOT FOUND"....
debugging
search
table
when