Suppose the followings are the keys for the VSAM :- ID,name and other department, salary.
So how can I query like
'Select Name, Department where ID = ?"
I’m looking to use JZOS only without additional Infrastructure .
The following will read the entire file which is not my option.
public static void readRecords(String fileName) throws Exception {
int lrecl = 80;
String options = "rb+,type=record";
ZFile zfile = new ZFile(fileName, options);
byte[] recBuf = new byte[lrecl];
try {
// read the records sequentially
while (zfile.read(recBuf) != -1) {
String record = new String(recBuf);
System.out.println("Record=" + record);
}
}
finally {
zfile.close();
}
}
New contributor
Alex Jone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.