IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DFSORT - compare counts and replace with detail count.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Jul 25, 2012 3:28 pm
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Wed Jul 25, 2012 3:35 pm
Reply with quote

Why not fix the program the creates the input file??
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jul 25, 2012 3:51 pm
Reply with quote

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
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Jul 25, 2012 4:00 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jul 25, 2012 4:10 pm
Reply with quote

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
View user's profile Send private message
Guest







PostPosted: Wed Jul 25, 2012 4:25 pm
Reply with quote

Ramsri
You could look for a start from this location: ibmmainframes.com/viewtopic.php?t=53873&postdays=0&postorder=asc&start=0
Back to top
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jul 25, 2012 4:32 pm
Reply with quote

Good searching devil13.

See how easy it can be ramsri?
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Jul 25, 2012 6:55 pm
Reply with quote

Thanks Devil13
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jul 25, 2012 7:14 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top