I have 100 records in a file.. i want to sort the records from
5 to 5o... give the syntax...

Answers were Sorted based on User's Feedback



I have 100 records in a file.. i want to sort the records from 5 to 5o... give the syntax.....

Answer / seema dawlekar

This can be done in two steps
in the step1 copy the the selective records by giving the
syntax as
skiprec = 4 -
stopaft = 50

this will copy only the selected records, now in the step2
we can perform sort
syntax is
sort fields=(starting position,length,type,A/D)
A--ascending and D--descending order

correct me if I am wrong

Is This Answer Correct ?    17 Yes 0 No

I have 100 records in a file.. i want to sort the records from 5 to 5o... give the syntax.....

Answer / anand

Follow the workaround below,
1.split the file into 3 files using IDCAMS
file1 1-4
file2 5-50
file3 51-100

2.Sort the mid file file2.

3.Finally merge all the 3 files using concatenation.

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More COBOL Interview Questions

what is amode(24), amode(31), rmode(24) and rmode(any)?

0 Answers  


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.

0 Answers   IBM,


what is the minimum number of lines a Cobol program should have to successfully compile and run

11 Answers   ABC, Societe Generale,


What are the differences bitween cobol and cobol-2?

1 Answers   Wipro,


plz,could any one tell me? what about EBCDIC in cobol?briefly?

1 Answers  






How do pass the values to the parameters in cobol

2 Answers  


can anyone explain me the concept of COMP-4 PLEASE??

2 Answers  


Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc

0 Answers  


in cobol main pgm is calling sub pgm but sub pgm does not exists , what abend i get if submit the job?

2 Answers   HSBC,


how will u pass dadta to cobol+db2 program...?

4 Answers   IBM,


I have two questions here. 1. How to read a flat file in reverse order? 2. How to read a VSAM KSDS file in reverse order? In both the cases we donot know the total number of records.

1 Answers   L&T,


what is the difference between occurs and occurs depending on? i dont think so there is the difference in storage..then why we should use occurs depending on?

9 Answers   TCS, Tech Mahindra,


Categories