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
 

 

Validating file with multiple header/trailer

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
mohitsaini
Warnings : 1

New User


Joined: 15 May 2006
Posts: 92

PostPosted: Thu Apr 13, 2017 1:53 am    Post subject: Validating file with multiple header/trailer
Reply with quote

Hi All,

I have coded the below Sort step to validate file for header, trailer, and count. It is working fine for a single header and trailer.

But when there are more than 1 header and trailer in the input then it doesn't work. Meaning it doesn't throw error. Can you please advise me how to modify the below sort card to throw error for multiple header/trailer.

Specifically if I get to read the last record (which is the trailer of the concatenated files) then I can do the verification that I am currently doing on TRL. Any advise will be really appreciated. Thanks

Code:
//STEP0100 EXEC PGM=SORT,PARM='NORC16'                             
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD DSN=input.file,DISP=SHR       
//              DD DSN=input.file,DISP=SHR ** two same files as an input doesn't give error.   
//SORTOUT  DD SYSOUT=*                                             
//HDR      DD SYSOUT=*                                             
//TLR      DD SYSOUT=*                                             
//SYSIN    DD *                                                     
  OPTION COPY                                                       
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(181:SEQNUM,9,ZD)),               
        IFTHEN=(WHEN=(19,6,CH,EQ,C'TRAILR'),                       
                OVERLAY=(181:181,9,ZD,SUB,+2,M11,LENGTH=9))         
  OUTFIL FNAMES=HDR,INCLUDE=(19,6,CH,EQ,C'HEADER'),NULLOFL=RC16     
  OUTFIL FNAMES=TLR,INCLUDE=(19,6,CH,EQ,C'TRAILR',                 
                            AND,25,9,CH,EQ,181,9,CH),               
                    NULLOFL=RC16                                   
//*   
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8028
Location: Bellevue, IA

PostPosted: Thu Apr 13, 2017 2:23 am    Post subject:
Reply with quote

Quote:
Can you please advise me how to modify the below sort card to throw error for multiple header/trailer.
This cannot be done, period. Mainframe systems do NOT "throw error" -- they may ABEND, they may have a non-zero step return code, they may have a user error, but they are not "throwing errors". Since the code NEVER will throw an error, we cannot tell you how to do it.

This is supposedly a forum for mainframe expert users -- you should KNOW by now what the terminology is and use it. If you want to throw errors, go work on a Unix or Windows machine.
Back to top
View user's profile Send private message
mohitsaini
Warnings : 1

New User


Joined: 15 May 2006
Posts: 92

PostPosted: Thu Apr 13, 2017 2:41 am    Post subject: Reply to: Validating file with multiple header/trailer
Reply with quote

Apologies for using incorrect term. What I meant by error was JCL step returning a non-zero return code (RC). I will take care of it from next time. Thanks.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 360
Location: USA

PostPosted: Thu Apr 13, 2017 3:36 am    Post subject: Reply to: Validating file with multiple header/trailer
Reply with quote

It is always better to show sample data. What do you have here:
Code:
AND,25,9,CH,EQ,181,9,CH
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8028
Location: Bellevue, IA

PostPosted: Thu Apr 13, 2017 4:32 am    Post subject:
Reply with quote

Quote:
But when there are more than 1 header and trailer in the input then it doesn't work
You have been on this forum for almost 11 years and have seen none of the posts stating that telling us something "doesn't work" is useless -- HOW did it not work?
Did it generate a SORT error?
Did it generate a non-zero return code for the SORT step (and if so, WHAT RETURN CODE)?
Did it generate an empty output data set?
Did it generate a data set with the correct data but no headers or trailers?
Did it generate a data set with the correct data and headers but no trailers?
Did it generate a data set with the correct data and headers and trailers but they are not correct (and if this is the case, HOW are they not correct)?
etc
etc
etc
There's LOTS of ways something "doesn't work" -- you need to give us at least a little information about what isn't working for us to help you! You should post at a minimum the SORT messages!
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2252
Location: @my desk

PostPosted: Fri Apr 14, 2017 3:20 am    Post subject:
Reply with quote

mohitsaini,

For a single input data set condition, it seems like you are trying to generate RC=16 when there is either no header record, or an incorrect trailer record count, from the control cards shown.

I think you need to define clearly when you want the concatenated input to be considered as invalid - no header records at all OR missing any one header record. Similarly any one trailer record count is incorrect OR none of them are correct, and so on. Well then, it leads to a question of if there is something within the data(detail records) that helps distinguish between the records from multiple data sets involved in the concatenation.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1676
Location: NY,USA

PostPosted: Fri Apr 14, 2017 4:29 am    Post subject:
Reply with quote

Quote:
But when there are more than 1 header and trailer in the input then it doesn't work.
Of course it won't work as there is not way your are restarting the sequence number and identifying the next header and trailer and so on....
RahulG31, TS is matching total record count to Trailer count.
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
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Length of Tape file Mohan Kothakota JCL & VSAM 9 Thu Apr 20, 2017 10:24 pm
No new posts Need help in reading and validating a... ABINAYATHULASI COBOL Programming 8 Tue Apr 18, 2017 11:42 am
This topic is locked: you cannot edit posts or make replies. Need help in estimating space of unlo... ashek15 IMS DB/DC 12 Fri Apr 07, 2017 5:11 am
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm


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