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
Which division and paragraphs are mandatory for a COBOL program?
What is the compute verb? How is it used?
What is the problem of ordered sequential files access?
What the difference is between continue and next sentence?
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
Write the code to count the sum of n natural numbers.
What are 77 levels used for?
A table has two indexes defined. Which one will be used by the SEARCH?
For rewrite, why is it mandatory that file needs to be opened?
how to access the file from prodution from changeman tool and to submit a file to production
can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech
i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this
I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?
How do u write test cases?
Why occurs cannot be used in 01 level in COBOL?