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

What is the difference between subscript and index?

1 Answers  


01 NAME1 PIC X(13) VALUE "COBOL PROGRAMMING". 01 NAME2 PIC X(13). now I want to display the value of NAME1 in reverse order i.e value should be displayed as "GNIMMARGORP LOBOC" HOW can I do that ??? please let me know if any one knows it.

11 Answers   FirstApex, NIIT,


wht is packed decimal in cobol

2 Answers  


How to recover a deleted source physical file from library?

1 Answers   HCL,


what is sort? whis is internal & external sort ?when do u go for inter sort & external sort? tell about some sort utilites?

2 Answers   BirlaSoft,






1.Is it possible to move the data from 99.99 to 99v99? 2.What is the CICS-vsam Compilation process? 3.In My GDG 5 generation will be there GDG3 got an abend what will happen? 4.In my GDG first generation is +1 And I want to add the new generation what will happen previous generation? 5.How can you give the PIC clause below conditions A). s9 (reddy), B). s9 (5) occurs 5 times? 6.How override the proc from a particular step? and what is symbolic and override Procs?

0 Answers   IBM,


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

0 Answers  


what is meaning by design document? who can repared for this?

5 Answers   TCS,


Why we are using comp and comp-3 in real time projects?

4 Answers   IBM,


how we separate the cobol cics statements from cobol&cics programming?

1 Answers   Valtech,


please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?

0 Answers   EDS,


where did you see the information regarding abend codes in jcl?

1 Answers   Hewitt,


Categories