How to read records from flat file in reverse order through
COBOL program?

Answer Posted / dimpy19

//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT DATASET,DISP=SHR
//SORTOUT DD DSN=YOUR OUTPUT FILE IN REVERSE ORDER,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
INREC FIELDS=(1,80,SEQNUM,8,ZD)
SORT FIELDS=(81,8,ZD,D)
OUTREC FIELDS=(1,80)
/*

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are 77 levels used for?

656


I have one ps file in which there are 3 fileds emp_no,emp_name and leave_app.this ps file information give the detail of employee which is going to apply for leave.suppose emp_no=113430,emp_name=ajay,leave_app=1 that means he is going to apply for 1 day leave.and accordingling the table in db2 will be updated means if he has that no of leave in his account then he will get dat leave and updated acc. in table(leave_balance=previous leave present in table-leave_app).Now i want to check whther the updated result is correct or not by comparing the two ps file using IEBCOMPARE or icetool so what is going to be the two ps file and how its is going to be compare.

2004


What is link edit in cobol?

748


)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?

1520


In which area will you utilize 88 level items in cobol?

713






Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.

2052


What is the difference between a binary search and a sequential search what are the pertinent cobol?

727


what is s000 u4087 error? please give the all error codes in cobol,jcl.

17026


Which Search verb is equivalent to PERFORM…VARYING?

680


write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

697


What is the utilization of copybook in cobol? Could we utilize a similar copybook?

711


1.Is it possible to move the data from 99.99 to 99v99? 2.What is the CICS-vsam Compilation process? 3.In My GDG 5 generation will be there GDG3 got an abend what will happen? 4.In my GDG first generation is +1 And I want to add the new generation what will happen previous generation? 5.How can you give the PIC clause below conditions A). s9 (reddy), B). s9 (5) occurs 5 times? 6.How override the proc from a particular step? and what is symbolic and override Procs?

5370


What is a SSRANGE and NOSSRANGE?

818


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.

5051


How did the release of cobol/370 version 1.3 improve the performance of release 1.1?

637