View previous topic :: View next topic
|
Author |
Message |
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
Hi,
I have an input file with 1 header and several detail records. The header comes with a count of detail records but sometimes contain wrong count.
INPUT:
Code: |
H 00002
Albert D'Souza Panaji Goa 90012 X6T Full
Francias Kartell Bestows Little Fountain 65093 M1L Scnd
Michale Sivadasan Pondicherry tools Hilton street F8S Curl
|
Expected Output:
Code: |
H 00003
Albert D'Souza Panaji Goa 90012 X6T Full
Francias Kartell Bestows Little Fountain 65093 M1L Scnd
Michale Sivadasan Pondicherry tools Hilton street F8S Curl
|
In the above file, the header shows count of 2 where as there are 3 detail records. The SORT should compare the count from header and no. of detail records and if its NOT EQUAL should replace 00002 with 00003.
Is this possible thru DFSORT? Or, Is it possible to compare the counts and in case of NE conditon throw an error code. Please help.
Thanks. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Why not fix the program the creates the input file?? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Yes, it is possible, but as Pabdora-Box has indicated, it is not the best idea.
If you count is different, do you have extra data? Less data? Is the count just wrong? 50 records which should be there missing and 49 records, which shouldn't be there, present?
Don't know the answer to the above? That's why you need to find the error/s in the program creating the file and fix them. |
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
We are specifically asked to fix it on our side by having such a validation. They ruled out of resending a fresh file with corrected header count.
Thanks. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Get that absolutely 100,000% in writing. Point out the possible implications (program error duplicating, loosing, adding spurious records, etc) and that your side of things wants written confirmation that the sender accepts all resposibility and possible costs for any errors arising from this.
Get your boss to write it. Or better the Director responsible, Get someone to review any Service Level Agreements, if applicable.
This is shoddy beyond belief, but just make sure that it does not come back to you.
Have you tried searching the DFSORT forum. If you can't find there, try google.
You could look at TRAILER1. Generate the header record and then arrange (SORT, or through concatenation) for the header to be the first record. |
|
Back to top |
|
|
Guest
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Good searching devil13.
See how easy it can be ramsri? |
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
Thanks Devil13 |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If the count does not matter, why change it? If it really mattered, it would be corrected prior to reaching this process. . .
Just ignore it in any part of the process that reads the file. |
|
Back to top |
|
|
|