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

Can a Search can be done on a table with or without Index?

788


how to convert the recors form vsam file to db2 table tru file aid

2740


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

695


How to print 10 to 1 if the input have only 10 digit number?

792


How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?

681






How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?

682


how do you reference the rrds file formats from cobol programs

771


What are declaratives and what are their uses in cobol?

692


What is the Purpose of POINTER Phrase in STRING command in COBOL?

703


How do define dynamic array in cobol.

650


What is the difference between binary search and sequential search?

628


Which division and paragraphs are mandatory for a COBOL program?

697


What is perform what is varying?

690


A table has two indexes defined. Which one will be used by the SEARCH?

735


Describe the cobol database components?

664