This forum is really helpful to me. I have got reply on so many questions. Thanks a lot to to Frank for all his replies.
Now i need one more help. I am trying to convert one cobol program which is running long to SORT so that it will be faster.
Let me tell you how is it now.
MAIN PROGRAM
-------------------
PERFORM till end of DRIVER FILE
a) Read DRIVER FILE KEY
b) Call Sub-program1 to match DRIVER FILE KEY with FILE1 KEY
and write record to OUTPUT-FILE1.
c) Call Sub-program2 to match DRIVER FILE KEY with FILE2 KEY
and write record to OUTPUT-FILE2.
d) Call Sub-program3 to match DRIVER FILE KEY with FILE3 KEY
and write record to OUTPUT-FILE3.
END-PERFORM
Can we achieve this in single SORT if we give
a) DRIVER FILE, FILE1, FILE2, FILE3 as input files and
b) OUTPUT-FILE1, OUTPUT-FILE2, OUTPUT-FILE3 as output files.
Please give your valid suggestions.
Let me know if i need explain my requirement in a better way.
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
Quote:
Let me know if i need explain my requirement in a better way.
Yes, you need to provide considerably more detail. Post all of the recfms of the files, the lrecls, and describe which positions are used for this process. Sample data of all inputs and the expected output from those inputs should be posted.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Chandramouli,
Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If any input file can have duplicates within it, show that in your example.
My original files are too big. So i just want to give simple lengths for now to know about approach. I have added some more details to make it more clear.
Driver File --> KEY position: 1:4 Numeric --> FB 4 byte file
FILE1 --> KEY position: 1:4 Numeric, Data position: 5:10 Character
format --> FB 14 byte file
FILE2 --> KEY position: 1:4 Numeric, Data position: 5:20 Character
format --> FB 24 byte file
FILE3 --> KEY position: 1:4 Numeric, Data position: 5:30 Character
format --> FB 34 byte file
OUTPUT-FILE1 --> FB 14 byte file. Should get File1 full record including KEY and data fields, if there is a match between Driver file key and File1 key.
OUTPUT-FILE2 --> FB 24 byte file. Should get File2 full record including KEY and data fields, if there is a match between Driver file key and File2 key.
OUTPUT-FILE3 --> FB 34 byte file. Should get File3 full record including KEY and data fields, if there is a match between Driver file key and File3 key.
Thanks,
Chandramouli
As i understand, WHEN=GROUP starts after WHEN=INIT adds SEQNUM to all records in T1. But i did not understand what does "BEGIN=(37,8,ZD,EQ,1),PUSH=(36:35,1)" perform. How does BEGIN and PUSH work?
I did not understand where is the logic of KEY comparison between
a) D1 and I1
b) D1 and I2
c) D1 and I3.