MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Syncsort: Trailer count validation

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Fri May 08, 2009 12:41 pm    Post subject: Syncsort: Trailer count validation Reply with quote

This might be a regular question, but I can't think of a way to handle all scenarios in 1 step. Looking out for expert's help...

Input File: RECFM=VB,LRECL=4355
Code:

Command ===>                                                  Scroll ===> CSR 
002641 C 00010400574601AS20040505332300          0000000000001000            08
002642 C 00010400574701AS20040505332300          0000000000001000            08
002643 C 00010800225501JH20080428332200          0000000000001000        &   08
002644 C 00010800225901JH20080428332200          0000000000001000        &   08
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
002645 C 9999999999CAP19990505     002643     \                               


The last record is a trailer record identified by 9999999999 in position 7 (3+RDW= 7) and Position 33 thru 37 is the count of records (excluding Header & Trailer)

I need to do the following
a. Count the number of data records and see if it matches with trailer
b. If yes then
Strip off the trailer from the input file and pass the header+data to next step
c. If NO then
1. The output file must be created "EMPTY"
2. Force return code of '4'
3. Based on the return code, the following step will send a email notification to respective group notifying them that the trailer count does not match

The output of this job is being fed to next job which concatenates multiple files. So, irrespective of the trailer count I should let the following job run. Either process one or more empty files (or) all files with data

Solution
a. I have the following sort to validate the trailer count and force RC 4 if it mismatches
b. Using COND, I send an email in the next step.
Code:

//R010  EXEC  PGM=SORT,PARM='NULLOUT=RC4'                           
//SORTIN  DD  DSN=DTF1.FFBATSPL.GENEXTFL.BLK#XXXX,                   
//            DISP=SHR                                               
//SORTOUT DD  SYSOUT=*                                               
//SYSOUT  DD  SYSOUT=*                                               
//SYSIN   DD  *                                                     
  INREC FIELDS=(1,4,          *  RDW FOR VB FILE  *                 
                5,40,         *  40 BYTES DATA CONTAINING TRL COUNT *
                SEQNUM,8,ZD)  *  8 DIGIT SEQUENCE NUMBER GENERATOR  *
  SORT FIELDS=COPY                                                   
  OUTREC FIELDS=(1,44,45,8,ZD,SUB,+2,ZD,LENGTH=8)                   
  OUTFIL INCLUDE=(7,10,ZD,EQ,9999999999,AND,                         
                  (33,6,ZD,EQ,45,8,ZD))                             
/*                                                                   


Question:
1. How do I strip off the trailer record from the input for a successful processing in the same SORT step.

My Syncsort version is "SYNCSORT FOR Z/OS 1.2.3.1R "

Thanks
Phantom
Back to top
View user's profile Send private message
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Mon May 11, 2009 3:48 pm    Post subject: Re: Syncsort: Trailer count validation Reply with quote

I'll get back to you on this.
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Tue May 19, 2009 10:01 am    Post subject: Reply with quote

Phantom,

I have run several tests and have come to the conclusion that I do not believe that this can be accomplished in a single step.

Regards,
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Fri May 22, 2009 10:02 am    Post subject: Reply with quote

Thanks for your feedback on this Alissa.

Regards
Phantom
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group