I had 100 records and i want to execute last three records by
using cobol programming?what will be coding?
Answers were Sorted based on User's Feedback
Answer / atul
Using Short card you can write the last 3 records.
Short card as :
SORT FIELDS=COPY SKIPREC=97 STOPAFT=03
It will copy the last three records and put it in a file.
Cobol program can use this file containing records.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / sandip
In cobol apply counter while reading file if counter reach at 97 start writing record to another file.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / harsha
Read file sequentially and load it in table. keep check on
the number of ocurances(i.e. number of records).
Once the table is fully loaded, you know the total
occurances. Say it is X. Now read the table with occurance
X-3
| Is This Answer Correct ? | 2 Yes | 2 No |
Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.
file status 00 is checked after opening the file or reading the file
How to read records which is in sequential file in reverse order ? Exp. 1 2 3 4 5 . i want 5 4 3 2 1?please clear my doubt any one
what are the isolation levels and where we use it in the db2 program
where do we use dyanamic call ? and where do we use static call pls give any example pls ?
can we use variable picture clause as xx.99 in cobol.
What is redefines clause in COBOL?
why occurs clause not mentioned in 01 level
6 Answers HCL, NIIT, TCS, Tesco,
can we print comp 3 stmts how ?
if a dataset is already created with fixed length but after that i want to change fixed length to variable length then how is it possible
Read a flat file and write last but one (I have n records in a file I have to write n-1th) record in another flat file. Could you please provide me the code in COBOL?
What are the rules of the move verb?