in cobol i have one file it contains records like
10,4,23,98,7,90..... total records 100. iwant 10 to 20 in
reverse order in cobol environ ment any one please give the
answer......

Answer Posted / ramesh kumar

let me explain the ans for if the file is PS.
fist compute the value 100-80 into one ws-variable.
then read the file and add 1 to some ws-count variable upto 20th record then check for the conditon if it is 20th record
like if ws-variable = ws-count
if it is then write into o/p rec, now decresae 1 from ws-variable like subtract 1 from ws-variable
and read file again add 1 to ws-count then check for the conditon if it is 19 recrd then write into o/p rec.
perform until ws-variable=0.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When is inspect verb is used in cobol?

902


What is the difference between PIC 9.99 and 9v99 in COBOL?

959


Write a program to explain size error.

877


) what is the difference between AID and HANDLE AID?

1876


what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.

8656


Discuss about changing dataset name in proc.

951


) How do u handle errors in BMS macro

1691


How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that

2945


how we sort two input files based on a common column and giving one o/p file please send me the coding logic?

1875


what is the difference between COBOL2 AND COBOL390?

2703


2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic

2341


how do you reference the ksds vsam file formats from cobol programs

867


Write a program to enter and display the names of students in a class using the occurs clause.

906


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

931


Have you used comp and comp-3 in your project? And how?

2185