Page 1 of 1

how to write sort condition to output file using cobol

Posted: Fri Aug 26, 2016 4:59 pm
by mohamedmubee
Hi Everyone,

I am new to this forum, so if there is any mistake teach me...

I would like to know how can we able to write a cobol program or logic to read a record from input file and write to a output file of length 80 bytes.
the input file has many records each 4 bytes of data.

input file:

ADAM
BASU
DAVE
JOHN
MARY
NICK
RAJA
SARA
......
.......

the output file should look like below...

INCLUDE COND=(1,4,EQ,C'ADAM,BASU,DAVE',
OR,1,4,EQ,C'JOHN,MARY,NICK',
OR,1,4,EQ,C'RAJA,SARA'),FORMAT=SS

Regards,
Mohamed

Posted: Mon Sep 05, 2016 7:29 pm
by dbzTHEdinosauer
why not look at other sort statements, such as JOIN,
where instead of the risk of creating a control card which would exceed the allowable length (or number of) control cards

JOIN would allow you to use the complete file of 4 char as a file and use it to match against another imput file.

Posted: Wed Aug 16, 2017 10:03 am
by Gentermen
I know what you guys think and tell others is very helpful.