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.



Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Are you comfortable in cobol or jcl?

641


Write a cobol program making use of the redefine clause.

729


how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)

1923


How do you differentiate between cobol and cobol-ii?

652


how we sort two input files based on a common column and giving one o/p file please send me the coding logic?

1646






I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......

10582


There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.

930


what is difference between cobol and cobol/400

21558


What are the different open modes available in cobol?

713


what is the difference between COBOL2 AND COBOL390?

2453


What is length is cobol?

647


What guidelines should be followed to write a structured cobol prgm?

668


What are different data types in cobol?

687


) How do u handle errors in BMS macro?

1427


Name some of the examples of COBOl 11?

2679