Hi...................
I have records like this
aaaa
cccc
bbbb
And i want output like this
bbbb
cccc
aaaa
How can it possible ?.
Note:Please make sure records are in unsorted order.
somebody plzzz help me.





Hi................... I have records like this aaaa cccc bbbb And i want output like this bb..

Answer / nsingh

SORT FIELDS=COPY
OUTREC FIELDS=(1,80,SEQNUM,ZD,4)

It will add sequence number at position 81 of 4 bytes in
ascending order.
Now Sort the sequence number in descending order to reverse
the sequence and then remove sequence number from file.

SORT FIELDS=(81,4,ZD,D)
OUTREC FIELDS=(1,80)

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More COBOL Interview Questions

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  


In COBOL programming, what is PERFORM? What is VARYING?

0 Answers   CDC,


What are the different data types available in COBOL?

4 Answers  


How do define Dymanic array in cobol how do u define single demensional arry and multidymensional arry in ur cobol.

4 Answers   Cap Gemini,


which certifications r 4 cobol,jcl,db2,cics what is format of xam n what is importance of these certifications... plz post answer only if u r sure... thanks

1 Answers  






What is SET TO TRUE all about, anyway?

5 Answers  


Consider the following COBOL entries 05 X PIC 99 VALUE 10. ADD 40 X TO X. COMPUTE X = 3 * X - 40. The result in X is

12 Answers   TCS,


What is the default value of DISP for temp datasets

5 Answers   IBM,


How to read records from flat file in reverse order through COBOL program?

14 Answers   Accenture, Broadridge, IBM, MAT, Polaris, SPIC, Syntel, TCS, Wipro,


Will the variable POS in the following code have a value of 2 or not? 01 POS PIC S9(4) COMP VALUE 2. 01 FIRST-NAME PIC X(10) VALUE 'ABC'. 01 LAST-NAME PIC X(10) VALUE 'XYZ'. 01 NAME PIC X(20) VALUE SPACES. STRING FIRST-NAME DELIMITED BY SPACES ' ' DELIMITED BY SIZE LAST-NAME DELIMITED BY SPACES INTO NAME WITH POINTER POS

2 Answers  


can you declare redefine in level 01?

8 Answers   Patni,


Explain complete concept of table handling in COBOL with an example?

2 Answers   IBM, TCS, Wipro,


Categories