Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 1529
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: 7232

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: 7232

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: 7232

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 Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us