Sunteți pe pagina 1din 3

1) i have a file which contains records like 10,30,90,50,20,40,80,60,70 i want to display these records in reverse order like 70,60,80,40,20,50,90,30,10

please give me the cobol code (do not sort the records) Ans) 01ARRAY1. 05 ARREC OCCURS 1 TO 50 TIMES DEPENDING ON WS-COUNT. 10 AR-EMP-ID PIC X(5). 10 AR-EMP-NAME PIC X(10). PROCEDURE DIVISION. OPEN INPUT INFILE. OPEN OUTPUT OUTFILE. PERFORM MOVE-RECORD UNTIL EOF = 'Y'. PERFORM PARA1 UNTIL WS-COUNT = ZEROS CLOSE INFILE. CLOSE OUTFILE. STOP RUN. MOVE-RECORD. READ INFILE AT END MOVE 'Y' TO EOF NOT AT END MOVE INREC TO ARREC(WS-COUNT) ADD 1 TO WS-COUNT. PARA1. MOVE ARREC(WS-COUNT) TO OUTREC WRITE OUTREC SUBTRACT 1 FROM WS-COUNT. 2) Can anyone tell me how to handle the array beyond the limit. If we have an array or a table which can handle 5000 records but now we have to compensate 20000 records with the same array? how to handle the situation. Ans) Use SSRANGE property. 3) what is the maximum error code in mainframe Ans) 4095 4) How To Separate The Numerics From An Alphanumric Data Item Which Contains Both Alphabates And Numerics ? ANs) 01 A pic x(10) value 'a1b2c34d5e'. 01 B pic x(5). (You want to move only numeric data from a to b)

PERFORM PARA1 VARYING I FROM 1 BY 1 UNTIL I>10 PARA1. IF A(I:1) IS NUMERIC MOVE A(I:1) TO B(I:1) END-IF END-PERFORM. DISPLAY "NUMERIC DATA IS:" B(I). 5) what is label record is standard or omitted in file description of data division? Ans) Label record standard is for disk files. (it is default). used to identify the disk files by the labels omitted is for card reader and printer files. 6) I have a file it contain 10 records.i got abend at 8th record because of soc7.how do you know that perticular record got abend? Ans) 1 Go to File manager view penal/edit penal. 2 Give file name and corresponding file layout(i.e. copybook) 3 Hit enter. You will be able to browse/edit the file. 4 On Command Line give 'FE(i.e. find error) Field Number. 5 File Manager will automatically take control to you to that record which have invalid data in that perticular field. You can perform the similar functionality in File Aid as well. 7) How many types of sorts are there in cobol? Ans) Two types of sort are there:-

1) DFSORT 2) SYNCSORT
8) what is the difference between PA & PF keys? Ans) PF key : Wake up the task and transmit

modified

data. PA Key : Wake up the task only.


9) How do you access the migrate the data from production
region to development region Ans) if a dataset is in migrate state , then just give as below 3.4 option dataset name enter hrecall <dataset name>

10) how to convert vsam table into DB2 table? 11)

S-ar putea să vă placă și