I would like to know how to split records using JCL.
Scenario is below,
I have a dataset which has students records of each exam like,
JAY ANNUALEXAM 7.9 FIRSTCLASS
RAM QUARTEREXAM 7.0 FIRSTCLASS
RAM HALFYRLYEXAM 7.6 FIRSTCLASS
RAM ANNUALEXAM 8.3 FIRSTCLASS
SAM QUARTEREXAM 6.5 FIRSTCLASS
SAM ANNUALEXAM 7.3 FIRSTCLASS
RAJ QUARTEREXAM 6.7 FIRSTCLASS
RAJ HALFYRLYEXAM 5.6 SECONDCLASS
DAV ANNUALEXAM 6.4 FIRSTCLASS
RAM QUARTEREXAM 7.0 FIRSTCLASS
RAM HALFYRLYEXAM 7.6 FIRSTCLASS
RAM ANNUALEXAM 8.3 FIRSTCLASS
SAM QUARTEREXAM 6.5 FIRSTCLASS
SAM ANNUALEXAM 7.3 FIRSTCLASS
RAJ QUARTEREXAM 6.7 FIRSTCLASS
RAJ HALFYRLYEXAM 5.6 SECONDCLASS
DAV ANNUALEXAM 6.4 FIRSTCLASS
the above nine records are in one single dataset. I need to split it into 2 records by using col(1,3) as key in runtime.
The key value should not be hard coded in the sort card.
The output files should like below,
File 1:
JAY ANNUALEXAM 7.9 FIRSTCLASS
RAM QUARTEREXAM 7.0 FIRSTCLASS
RAM HALFYRLYEXAM 7.6 FIRSTCLASS
RAM ANNUALEXAM 8.3 FIRSTCLASS
RAM QUARTEREXAM 7.0 FIRSTCLASS
RAM HALFYRLYEXAM 7.6 FIRSTCLASS
RAM ANNUALEXAM 8.3 FIRSTCLASS
File 2:
SAM QUARTEREXAM 6.5 FIRSTCLASS
SAM ANNUALEXAM 7.3 FIRSTCLASS
RAJ QUARTEREXAM 6.7 FIRSTCLASS
RAJ HALFYRLYEXAM 5.6 SECONDCLASS
DAV ANNUALEXAM 6.4 FIRSTCLASS
SAM ANNUALEXAM 7.3 FIRSTCLASS
RAJ QUARTEREXAM 6.7 FIRSTCLASS
RAJ HALFYRLYEXAM 5.6 SECONDCLASS
DAV ANNUALEXAM 6.4 FIRSTCLASS
Regards,
Dhamodharan K
Code'd