Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DFSORT - compare counts and replace with detail count.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: DFSORT - compare counts and replace with detail count.
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

Moderator


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

PostPosted: Wed Jul 25, 2012 3:35 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Jul 25, 2012 3:51 pm    Post subject: Reply to: DFSORT - compare counts and replace with detail co
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    Post subject: Reply to: DFSORT - compare counts and replace with detail co
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Jul 25, 2012 4:10 pm    Post subject: Reply to: DFSORT - compare counts and replace with detail co
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    Post subject:
Reply with quote

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Jul 25, 2012 4:32 pm    Post subject: Reply to: DFSORT - compare counts and replace with detail co
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    Post subject: Reply to: DFSORT - compare counts and replace with detail co
Reply with quote

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

Site Director


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

PostPosted: Wed Jul 25, 2012 7:14 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us