This file as numbers and letters.
The numbers are "Operation Number" and the letters are "Invoice Number".
In this file what I am saying is that the invoice "AAAAAAA" was modified in two operations ("1111111" and "4444444"). The invoice "BBBBBBB" was modified on "2222222" and "4444444"... and so one.
One invoice could have one or too many operations, and one operation could have one or many invoices.
What I wanna do (and believe me, I don't know if it is possible) is to have an output that gives me the relationship of the operations by looking at the invoices.
The output is generated by looking to invoice "AAAAAAA" and get all the operations: "1111111" and "4444444".
Then I will say that operation "1111111" is connect with both operations because one time in the future the invoice was modified by both operations.
So I have
Code:
1111111AAAAAAA1111111
1111111AAAAAAA4444444
Now I must replicate the same relationship with operation number "44444444":
Code:
4444444AAAAAAA1111111
4444444AAAAAAA4444444
Now that I have analysed the invoice "AAAAAAA" I will do it for invoice "BBBBBBB" and so on...
I know that this could be hard to explain, but feel free to ask questions.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
rafaelantunes,
You can do this with the new WHEN=GROUP function of DFSORT available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008). I assumed that you can have a max possible variations with each key. If you have more than we can adjust the job.
I have a few comments:
a) I think I do not have the new WHEN=GROUP function of DFSORT as it return an error while running your code exactly at that line of code;
b) You assumed that I have a max possible variations, but... I don't... I mean I can jump in with a number because that number could be huge... One million? Two million... I don't know. What I can say is that I now have 20.000.000 of operations and it rises in average 8.000.000/year;
c) In your code you have added letters as operations numbers...
Code:
0000000EEEEEEE
AAAAAAAEEEEEEE
BBBBBBBEEEEEEE
This doesn't happen.
d) I put this question here but I really don't know if it is possible...
Maybe if we copied the input file and sort them by invoice number... like this
ICE751I 0 C5-K24705 C6-K90007 C7-K90000 C8-K90007 E7-K24705
ICE052I 3 END OF DFSORT
Quote:
Is there some business reson why not?
Yes... I believe so... Since when I asked my superiors about that possibility the answer was "Out of question"... I don't know why... sorry.
Quote:
What is the problem with the code that already meets your requirement? If i understood correctly, you already have code working?
Don't know if I understood your comment but... if you were refering about my actual solution that is by running a COBOL program, than I must say that it works, but has a few disavantages:
a) Time for implementation (I have to implement about 8/10 programs since the data is diferent (size, type, etc...)
b) Future maintenance, it's easier to do maintenance on only the JCLs rather than COBOL (recompile, envoriments, etc.)
c) The execution time... Its not fast...
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
It may be that you are not using the most current dfsort ptf. If you run any sort that runs successful and post the complete ICE201I message, we will be able to see which ptf level is installed.
Quote:
Since when I asked my superiors about that possibility the answer was "Out of question"...
That would not be a business reason, but a just a statement of preference (which you may have to accept, unfortunately ).
Quote:
a) Time for implementation (I have to implement about 8/10 programs since the data is diferent (size, type, etc...)
b) Future maintenance, it's easier to do maintenance on only the JCLs rather than COBOL
Sorry, but i disagree with these. If the code is already working and the other requirements are the same except they have different input, it should be faster to clone the already working code to use the new attributes than go thru all of the control statements and modify them to the new data positions. If you are not available, will the expectation be that the DFSORT developers perform maintenance on the processes . . .
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
rafaelantunes,
That error message indicates you do not have z/OS DFSORT V1R5 PTF UK90013 (July, 2008). If you want to use WHEN=GROUP, ask your System Programmer to install that PTF (it's free).
Kolusu and I are on vacation today. So he probably won't see/respond to your latest post until Monday. If you like, you could send him a note offline (skolusu@us.ibm.com) asking him to respond on Monday indicating if you'll be able to use WHEN=GROUP or not.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
rafaelantunes,
I can change the job to use splice and get the results but it is also limited to the number of variations you can have for EACH KEY
Quote:
You assumed that I have a max possible variations, but... I don't... I mean I can jump in with a number because that number could be huge... One million? Two million... I don't know. What I can say is that I now have 20.000.000 of operations and it rises in average 8.000.000/year;
Wow. 20 million variations for each key? Are you telling me the file size or each KEY can have a 20,000,000 variations ? That is a lot of variations.
what is the max no: of operations a single Invoice can have? If it is under reasonable number (25) then we can do using SORT. If you have more than that then you probably are better off writing a program.
Yes... Unfortunatly I do have more than 25 possible relations...
In some cases is one million...
arcvns did sent me a possible solution that works with the example that I gave at the begining of the topic, altough with the real files, it takes forever and then it abends with out of space reason.
I do believe that the most right decision is to writing a COBOL program.