How do you sort in a COBOL program? Give sort file
definition, sort statement syntax and meaning.

Answers were Sorted based on User's Feedback



How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning...

Answer / kavya

As he told above we need to specify the sort-file in sd
entry.
But syntax is as follows,

SORT SORT-FILE ON ASCENDING/DESCENDING KEY
USING INPUT-FILE
GIVING OUTPUT-FILE.

We have to specifies the key to sort.
INPUT-FILE is the file to sorted.The sorted OUTPUT is sent
to the OUTPUT-FILE.

Is This Answer Correct ?    34 Yes 3 No

How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning...

Answer / guest

second ans is correct

Is This Answer Correct ?    15 Yes 3 No

How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning...

Answer / ram

THE ABOVE ONE IS CORRECT

Is This Answer Correct ?    7 Yes 1 No

How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning...

Answer / mftech

Need to define the SORT-FILE in SD in file section.

Sort SORT-FILE
Using Input-File
Giving Output-File

Can also use inout procedure and output ptocedure inplace
of input fiile and output files.

Is This Answer Correct ?    14 Yes 10 No

How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning...

Answer / subhashini

we can sort a cobol program define SD SORT-FILE in
FILE SECTION
THE SYNTAX IS
SORT SORT-FILE IN ASCENDING/DESCENDING KEY USING
INPUT-FILE GIVING OUTPUT-FILE.

Is This Answer Correct ?    8 Yes 5 No

How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning...

Answer / nagaraju

SORT SORT-FILE
ON ASCENDING/DESCENDING KEY key-value
USING input-file
GIVING output-file.

we can use input procedure and output procedure as fallow
SORT SORT-FILE
ON ASCENDING/DESCENDING KEY key-value
INPUT PROCEDURE IS --------
OUTPUT PROCEDURE IS -------.

Is This Answer Correct ?    4 Yes 2 No

How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning...

Answer / bhaskar reddy

This is the exam for the sort command:

SORT SORTFILE ON ASCENDING/DESCENDING KEY USING FILE1,FILE2
GIVING FILE3.

Is This Answer Correct ?    2 Yes 3 No

Post New Answer

More COBOL Interview Questions

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

11 Answers   ABC, Societe Generale,


Can we move X(7) to S9(7) COMP?

1 Answers  


When can the USING phrase be included in the call statement ?

2 Answers  


Can we dynamically increase the size of occurs clause? i.e In case I an not sure of the size of array and want to increase the size at run time.If yes , how?

1 Answers  


how you read control card into array?

3 Answers   HCL,






01 text-data pic x(100). move 'xyzdbfrjjg u' to text-data. how to find the value of last index of text-data?

3 Answers   Mind Tree,


I have a PS file and I would like to manually insert the binary values (like a COMP format) into the file. How can i do that? the way do in COMP-3 format.. suppose i want to insert -12345 in to file in comp-3 format. simply we can open a file in edit mode and do HEX-ON and insert the value . SEE BELOW-- 135 24D in 3 bytes - this will be COMP-3 presenatation of -12345.

1 Answers  


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

1 Answers   IBM,


In A cobol program , we can use COPY Statement in FILE- SECTION / WORKING-STORAGE SECTION / ENVIRONMENT DIVIION basically what is the difference

3 Answers   IBM,


how many bytes does s9(15) occupy in comp1 comp2 and comp3 ?

4 Answers   TCS,


How do define dynamic array in cobol.

0 Answers  


what if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9(4) ........ IF(B NUMERIC) ADD 10 TO C a.the condition in the if statement is wrong b.noting is wrong c.because C is initialised.ADD 10 TO C is wrong d.both B and C shoud have same size.

5 Answers   TCS,


Categories