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
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 |
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 |
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 |
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 |
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 |
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?
When can the USING phrase be included in the call statement ?
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?
how you read control card into array?
01 text-data pic x(100). move 'xyzdbfrjjg u' to text-data. how to find the value of last index of text-data?
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.
If I want to increase the Limit in GDG. What should I do?
In A cobol program , we can use COPY Statement in FILE- SECTION / WORKING-STORAGE SECTION / ENVIRONMENT DIVIION basically what is the difference
how many bytes does s9(15) occupy in comp1 comp2 and comp3 ?
How do define dynamic array in cobol.
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.