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

Comparing Header and Trailer.


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

New User


Joined: 21 Jul 2022
Posts: 3
Location: Banglore, India

PostPosted: Thu Sep 15, 2022 5:12 pm
Reply with quote

We have a output file and it already has header and trailer in it. So, we need a JCL to check whether the header date and trailer count in correct. If the count mismatches the job should fail. Which utility can be used or any sample JCL would be fine.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Thu Sep 15, 2022 5:57 pm
Reply with quote

JCL cannot help you, but almost any other tool can.

You have placed you topic under DFSORT section. Are you familiar with SORT? Is yes, you can try:
1) split your data into two intermediate temporary datasets: the numbered headers, and the numbered trailers.
2) join those two datasets on their record numbers, and verify or compare any desired field(s) in every paired record.

Remains completely unclear, what to consider as "correct date", and "correct count"????
The title is "Comparing headers and trailers". Does this mean, all your headers must be equal to your trailers???

I guess the correct approach should be: to ignore all existing headers and trailers, and to generate new correct ones.


This forum doesn't provide a ready solution from scratch, unless the author has demonstrated his own efforts to solve his own problem.


BTW, it is a very doubtful requirement: "the job should fail"...
Would it really help if the only result of you job was like this?
...... TESTJOB FAILED ABEND S000 U1234 ......
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1335
Location: Bamberg, Germany

PostPosted: Thu Sep 15, 2022 6:24 pm
Reply with quote

Basically the output dataset should be created the right way. Why is it possible that Header/Trailer are incorrect? Second, I agree what has been written, generating correct Header/Trailer records makes more sense.
Back to top
View user's profile Send private message
Vikash Arjun

New User


Joined: 21 Jul 2022
Posts: 3
Location: Banglore, India

PostPosted: Thu Sep 15, 2022 6:29 pm
Reply with quote

Thank You Joerg.Findeisen,

I would say the file is created by UNIX and I am trying to PULL the file from UNIX to Mainframe. So, if the header and trailer count is not correct or if there is a mismatch on the file, we need a COND where the job should fail.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Thu Sep 15, 2022 7:02 pm
Reply with quote

I need to repeat again: no matter where your "file" has come from.
If only you suspect it has wrong information in it, it makes no sense to just indicate it, and to start a long process on forcing other people to re-create the correct output for you to use it.

The better and faster approach should be: to ignore all existing (maybe wrong) headers and trailers, and to generate new correct ones.


Anyway: in order to verify the "correctness" of existing headers and trailers, you NEED to create the correct ones! If so, why no to immediately replace the potentially wrong information with the proven correct one?
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 420
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Thu Sep 15, 2022 10:56 pm
Reply with quote

try this ibmmainframes.com/about29854.html
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1335
Location: Bamberg, Germany

PostPosted: Thu Sep 15, 2022 11:22 pm
Reply with quote

What @sergeyken said is IMHO the best way, discard HDR/TRL records and create valid ones. There is no need to flush anything then because the data is valid.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Fri Sep 16, 2022 12:50 am
Reply with quote

When headers/totals of the transferred file are incorrect, it MUST be fixed by the creator of this wrong data.

If not fixed, then dismissal, or death penalty may be the good action for him.
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 SORT on detail record, then repeat he... DFSORT/ICETOOL 3
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Insert trailer for non empty file only DFSORT/ICETOOL 6
No new posts Adding a trailer with record count an... JCL & VSAM 4
No new posts Build a trailer with total an count SYNCSORT 6
Search our Forums:

Back to Top