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 |
what is difference between the sysabend and userabend?
Hi Guys, I have faced one interview question if I have requirement to add 5 new columns to existing table what are prerequisite do i need to take.
In which area will you utilize 88 level items in cobol?
If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly
without performing any operations on a file how can i know whether it contains data or not
What will happen if a variable is declared as below.. Explain with an example? Working storage section:- 01 WS-VARX PIC X(9) VALUE SPACES. 01 WS-VARN REDEFINES WS-VARX PIC 9(9).
Can we call a CICS program from a batch program or viceversa?If so, how?
can we use go to statement inline-perform?
what is soc7 abend?how u can trace it?
I have PS flat file with 14 records. I want to read from 4th to 9th record and want to write those 6 records (4th record to 9th record) to another PS file (output file). there is no key defined in the input file. I just want read a certain Consecutive records. can any one please give me the procedure division Coding for this. I have coded the below coding but the READ-PARA is performing only 1 time even though I have 14 records in my input file (i.e FILE-1): PROCEDURE DIVISION. A000-SECTION. MOVE 0 TO I. OPEN INPUT FILE-1. IF CHECK-KEY1 > 0 DISPLAY "OPEN ERROR FOR FILE-1, CODE IS:" CHECK-KEY1 END-IF. OPEN EXTEND NEWFILE-1 IF CHECK-KEY3 > 0 DISPLAY "OPEN ERROR FOR NEWFILE-1 COD IS" CHECK-KEY3 END-IF. PERFORM READ-PARA THRU EXIT-PARA UNTIL EOF-REC = 'YES'. DISPLAY " FINALLY OUT OF LOOP" CLOSE FILE-1 CLOSE NEWFILE-1 STOP RUN. READ-PARA. ADD 1 TO I READ FILE-1 AT END MOVE 'YES' TO EOF-REC IF I > 3 AND < 10 PERFORM WRITE-PARA ELSE DISPLAY "NOT IN RANGE" END-IF. EXIT-PARA. EXIT. WRITE-PARA. WRITE NEW-REC FROM FILE1-REC.
Have you code any new programs in COBOL ? What is the functionality of the programs?
How to declare if emp-name = AAAAA""BBB in working-storage section. After display emp-name should print like AAAAA""BB