COBOL
Write a COBOL program that displays "HELLO, MAINFRAME WORLD!" on the screen....
hello-world
display
basics
COBOL
Write a program that accepts a user's name and displays a personalized greeting....
accept
input
working-storage
COBOL
Write a program that displays the current date in MM/DD/YYYY format....
date
accept
formatting
COBOL
Write a COBOL program that displays "Welcome to COBOL Programming" and demonstrates all four divisions....
basics
structure
divisions
COBOL
Write a program that accepts user name and displays a personalized greeting....
accept
display
input
output
COBOL
Write a well-commented program that calculates area of rectangle....
comments
documentation
basics
COBOL
Explain and demonstrate the difference between STOP RUN and GOBACK....
stop-run
goback
termination
COBOL
Create a program demonstrating proper use of COBOL reserved words like MOVE, ADD, DISPLAY....
reserved-words
syntax
basics
COBOL
Use INITIALIZE to set fields to default values....
initialize
reset
default
COBOL
Concatenate multiple fields using STRING statement....
string
concatenate
delimited
COBOL
Use INSPECT to count and replace characters....
inspect
tallying
replacing
converting
COBOL
Demonstrate different numeric PIC clauses: 9, S, V, P....
pic
numeric
data-types
COBOL
Work with alphanumeric (PIC X) and alphabetic (PIC A) data types....
alphanumeric
alphabetic
pic-x
COBOL
Create a record structure with group and elementary items....
group
elementary
record
structure
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
Write a program that accepts two numbers and displays their sum....
add
arithmetic
numeric
COBOL
Accept 5 numbers and calculate their average....
compute
average
loop
COBOL
Demonstrate ADD, SUBTRACT, MULTIPLY, DIVIDE with all variations....
add
subtract
multiply
divide
COBOL
Use COMPUTE for complex mathematical expressions....
compute
compound-interest
formula
COBOL
Calculate percentage increase, decrease, and percentage of total....
percentage
calculation
arithmetic
COBOL
Convert between USD, EUR, GBP, and INR....
currency
conversion
exchange-rate
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 number and determine if it is positive, negative, or zero....
if-else
conditions
signed
COBOL
Accept marks (0-100) and display grade: A(90+), B(80-89), C(70-79), D(60-69), F(<60)....
evaluate
grades
conditions
COBOL
Demonstrate nested IF statements and ELSE clause....
if
else
conditional
nested
COBOL
Determine if a year is a leap year....
leap-year
divisibility
date
COBOL
Given three sides, determine triangle type: Equilateral, Isoceles, Scalene, or Invalid....
triangle
geometry
validation
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
Use a loop to print numbers from 1 to 10....
perform
loop
counter
COBOL
Print multiplication table for a given number....
multiplication
loop
table
COBOL
Execute a paragraph a specific number of times....
perform
times
loop
iteration
COBOL
Loop until a condition becomes true....
perform
until
while
loop
COBOL
Generate first N Fibonacci numbers....
fibonacci
sequence
algorithm
COBOL
Print a pyramid pattern of stars for N rows....
pattern
pyramid
loop
stars
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
Reverse a given string....
string
reverse
algorithm
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
Parse a comma-separated record into individual fields. Input: "JOHN,DOE,35,NEW YORK"...
unstring
csv
parsing
delimited
COBOL
Create and access a single-dimension table (array)....
table
array
occurs
subscript
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
Read two sorted files and merge them into one sorted output file....
file
merge
sort
algorithm
COBOL
Update master file with transactions: A=Add, U=Update, D=Delete. Both files sorted by key....
file
master
transaction
batch
COBOL
Use REPORT WRITER to generate formatted report....
report
formatting
output
COBOL
Generate report with control breaks (subtotals by group)....
control-break
subtotal
report
COBOL
Use COPY to include copybook members....
copy
copybook
include
replacing
COBOL
Call a subprogram and pass parameters....
call
subprogram
linkage
using
COBOL
Understand difference between BY REFERENCE and BY CONTENT....
call
reference
content
value
JCL
Write basic JCL to run a program called MYPROG....
job
exec
basic
JCL
Write JCL that reads from dataset MY.INPUT.FILE....
dd
input
disp
JCL
Write JCL that creates a new sequential dataset....
dd
output
dcb
COBOL
Read VSAM KSDS file sequentially....
vsam
ksds
sequential
indexed
COBOL
Read VSAM KSDS randomly by key....
vsam
ksds
random
direct-access
COBOL
Add new records and update existing records in KSDS....
vsam
write
rewrite
update
JCL
Copy specific members from one PDS to another....
iebcopy
pds
copy
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
JCL
Write JCL to create a new generation of a GDG and also reference the previous generation....
gdg
generation
versioning
JCL
Create and call a JCL procedure....
proc
procedure
symbolic
override
JCL
Create job where step execution depends on previous step outcome....
jcl
if-then
conditional
multi-step
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
Calculate gross pay, deductions, and net pay. Regular hours up to 40, overtime at 1.5x....
payroll
business
calculation
COBOL
Read employee file, calculate tax based on salary slabs, generate formatted salary report. Tax Slabs: 0-25000: 0%, 25001-50000: 10%, 50001-100000: 20%...
payroll
report
tax
evaluate
COBOL
Track product inventory: add stock, sell items, show low stock alerts (below 10 units), generate inventory report....
inventory
tables
business
menu
COBOL
Simulate ATM: PIN verification (3 attempts), check balance, withdraw (multiples of 100, max 20000), deposit, mini statement (last 5 transactions)....
atm
banking
security
transactions
COBOL
Generate itemized bill: multiple items with quantity and price, apply discount if total > 1000, add GST 18%, print formatted bill....
billing
invoice
business
calculation
COBOL
Manage student records: add students, record marks for 5 subjects, calculate total/average/grade, show class topper....
grades
students
tables
business
COBOL
Process customer orders: validate customer ID, check product availability, calculate total, apply loyalty discount, update inventory....
order
ecommerce
business
validation
COBOL
Generate monthly bank statement: opening balance, all transactions, closing balance, interest calculation....
banking
statement
running-balance
interest
COBOL
Calculate insurance premium based on age, coverage amount, and risk factors....
insurance
premium
risk
calculation
COBOL
Track employee leave: apply leave, approve/reject, show balance, generate leave report....
leave
hr
employee
management
COBOL
Manage patient records: admit, discharge, view details, bill calculation....
hospital
patient
healthcare
billing
COBOL
Manage library: add books, issue, return, check availability, fine calculation....
library
books
management
fine
COBOL
This code has an infinite loop. Find and fix it:
PERFORM VARYING WS-I FROM 1 BY 1
UNTIL WS-I = 10
DISPLAY WS-I
END...
debugging
loop
bug-fix
COBOL
Result shows wrong value:
01 WS-PRICE PIC 99V99 VALUE 12.50.
01 WS-QTY PIC 99 VALUE 5.
01 WS-TOTAL PIC 99V99.
M...
debugging
decimal
truncation
COBOL
Result is wrong:
01 WS-A PIC 9(3) VALUE 999.
01 WS-B PIC 9(3) VALUE 999.
01 WS-C PIC 9(3).
ADD WS-A TO WS-B GIVING WS-C....
debugging
truncation
overflow
COBOL
Loop executes wrong number of times:
PERFORM VARYING WS-I FROM 1 BY 1 UNTIL WS-I = 10
DISPLAY WS-I
END-PERFORM....
debugging
perform
loop
boundary
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