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......

Answers were Sorted based on User's Feedback



in cobol i have one file it contains records like 10,4,23,98,7,90..... total records 100. iwant 10 ..

Answer / 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

in cobol i have one file it contains records like 10,4,23,98,7,90..... total records 100. iwant 10 ..

Answer / karthick

Ya its simple.......
U can select these records as primary key in ksds cluster.
In cobol program you specify access as random. then select
particular records. and then sort it out in reverse order.

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More COBOL Interview Questions

OCCURS clause is used in the DATA DIVISION on data names at (a) 01 level (b) 77 level (c) 88 level (d) any level from 02 to 49

13 Answers   TCS,


Can we redefine the field of x(200) to less than 200?

0 Answers  


EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?

0 Answers   Accenture,


If I want to increase the Limit in GDG. What should I do?

2 Answers   IBM,


how we rectify soc7 and soc4 errors in project?

1 Answers   Anaxis, TCS,






what is soc7 abend?how u can trace it?

4 Answers   Accenture,


wht r the advantages of 77 level number ?

8 Answers   TCS,


How can I find the maximum value of a field in a file while reading the file dynamically? without using sort function. Suppose i have a file with fields Timestamp, description, teamname, teamnumber.. i have read the file till end and find the maximun value of timestamp which is not in sorted order.. can we use function max(timestamp)?

1 Answers   CGI,


Explain fixed length record in cobol? with suitable example

1 Answers   IBM,


How can we find that module can be called – whether DYNAMICALLY or STATICALLY?

0 Answers  


How to resolve the soc4 & soc7 other than following answers. Soc4 can resolved using mispleed dd name and dd name is not matching with file and soc7 check the sysdump and copy the offest address then correct it in the program.

10 Answers   ADP, Amdocs, Cap Gemini, Keane India Ltd, Super Value, TCS,


Which Search verb is equivalent to PERFORM…VARYING?

0 Answers  


Categories