How to read the last 100 records from a COBOL file. The file
contains N number of records.
Answer Posted / heeraj r
Pls post the correct question. I am not sure what you mean
by COBOL file, is it PS or VSAM or Tape etc etc? If you
want last 100 records of a file use below SORT JCL, and if
required that output file can be read in your COBOL.
//S1 EXEC
PGM=ICETOOL
//TOOLMSG DD
SYSOUT=*
//DFSMSG DD
SYSOUT=*
//IN DD DSN=... input
file
//OUT DD DSN=... output file
//TOOLIN DD
*
SUBSET FROM(IN) TO(OUT) KEEP INPUT LAST(100)
/*
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
How do u write test cases?
how do you reference the ksds vsam file formats from cobol programs
Can we change the password using ALTER? anyone tried and changed?
How arrays can be defined in COBOL?
Name the divisions, which are available in a cobol program?
What is redefines clause in COBOL?
How do you define a variable of comp-1 and comp-2?
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
Are you comfortable in cobol or jcl?
For rewrite, why is it mandatory that file needs to be opened?
INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?
What is the difference between next sentence and continue in cobol programing language?
What the difference is between continue and next sentence?
What are the different rules of SORT operation?
What is a report item?