Matchingthe trailer record with the number of records



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Matchingthe trailer record with the number of records

Postby shilpakhaire » Fri Apr 03, 2009 12:38 am

Hi all,

I want to match a trailer record with the total no of data records in my file
Trailer recod looks like this:
TRAILER 20090401 1304760

I am trying this using a SORT step s below:

//PS000010 EXEC PGM=SORT                                       
//SYSOUT  DD SYSOUT=*                                           
//SORTIN  DD DSN=myid.input,DISP=SHR     
//OUT     DD DSN=myid.AUD,                         
//           DISP=(NEW,CATLG,DELETE),                           
//           UNIT=(,30),                                       
//           SPACE=(TRK,(1,1)),                                 
//           DCB=(DSORG=PS,RECFM=FB,LRECL=38,BLKSIZE=38)       
//SYSIN   DD *                                                 
  OPTION COPY                                                   
  INREC BUILD=(1,26,SEQNUM,12,ZD,START=0)                       
  OUTFIL FNAMES=OUT,NULLOFL=RC4,                               
         INCLUDE=(1,07,CH,EQ,C'TRAILER',AND,                   
                 (18,12,ZD,EQ,27,12,ZD))


I am getting MAXCC=0 but the output file is empty whcih is whay I am confused.
I also want to comapre the date in the trailer record with a DATE file.Can I accomplish this one step? Please help me with this?
Thanks,
Shilpa
shilpakhaire
 
Posts: 17
Joined: Fri Oct 31, 2008 9:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Matchingthe trailer record with the number of records

Postby shilpakhaire » Fri Apr 03, 2009 12:52 am

HI Frank,

I need ur help with this As sson as possible. Your expertise is highly needed!

Thanks,
Shilpa
shilpakhaire
 
Posts: 17
Joined: Fri Oct 31, 2008 9:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Matchingthe trailer record with the number of records

Postby Frank Yaeger » Fri Apr 03, 2009 1:00 am

You need to do a better job explaining what you want to do. The job you show only uses one input (myid.input) so how does both the file with the trailer record and the file with the data records enter into it?

Please explain more clearly what you want for output for the different cases (trailer count matches number of input records; trailer count does not match the number of input records). Give the RECFM and LRECL of each input file. Give the starting position, length and format of each relevant field in the input files.

I also want to comapre the date in the trailer record with a DATE file.Can I accomplish this one step?


Again, you need to explain more clearly what you want to do. What does this DATE file look like? What do you want to compare the date in the trailer record to and what output are you expecting?
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Matchingthe trailer record with the number of records

Postby shilpakhaire » Fri Apr 03, 2009 1:16 am

Let me explain :

input (myid.input) is the file which has a trailer record as the last record.
TRAILER 20090401 1304760 ----->the last figure is the record count.
I want to compare this record count with the actual no of data records in the file (myid.input) . This file also has a header record. The record count on the Trailer record is the count of the actual data records, it excludes the header and trlr record.
If the count matches, we should get some statistics as:
No of records in input file= 1304760
TRailer record count = 1304760.
But if the count deos not match, the job shound give a RC of 8.
Inthe input file , the record looks as given below....just data records.
U00000000345678906000+00000000+200902......................

The date file has just the date in it - '2009-04-01'. It just has to compare this date with the date in the trailer record. And give an RC of 8 if it does not match. If it matches just,
give stats as below:
Date in the trailer record= 20090401
Date in the Date file - 20090401.

Thanks,
Shilpa
shilpakhaire
 
Posts: 17
Joined: Fri Oct 31, 2008 9:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Matchingthe trailer record with the number of records

Postby Frank Yaeger » Fri Apr 03, 2009 2:09 am

What is the RECFM of myid.input?

What is the starting position and length of the date field and count field in the trailer record?

What is the starting position of the data in the date file record?

DFSORT cannot give a RC of 8. Is greater than 8 ok (e.g. 12, 16)?

Do you want to do both of these comparisons (count, date) in the same step or in different steps?
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Matchingthe trailer record with the number of records

Postby shilpakhaire » Fri Apr 03, 2009 4:50 am

I am answering the questions below:
1. What is the RECFM of myid.input?
FB

What is the starting position and length of the date field and count field in the trailer record?
TRAILER 20090301 11
Date field -
Starting position - 9
Length - 8
Rec-cnt field -
Starting position - 18
Length - 7

3.What is the starting position of the data in the date file record?
Staring poisiton of the actual date is 4. On th ethird position we have a quote -'2009-03-31'

4. DFSORT cannot give a RC of 8. Is greater than 8 ok (e.g. 12, 16)?
Sure. The job ahould abend.

Do you want to do both of these comparisons (count, date) in the same step or in different steps
I would prefer one step, but if its complicated then 2 steps should do.

Thanks,
Shilpa
shilpakhaire
 
Posts: 17
Joined: Fri Oct 31, 2008 9:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Matchingthe trailer record with the number of records

Postby shilpakhaire » Fri Apr 03, 2009 7:35 pm

GM FRank!
Is there any way to do this?

Thanks,
Shilpa
shilpakhaire
 
Posts: 17
Joined: Fri Oct 31, 2008 9:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Matchingthe trailer record with the number of records

Postby Frank Yaeger » Fri Apr 03, 2009 8:38 pm

I just got in to work. I have some ideas, but I need some time to work them out. Will post later today.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Matchingthe trailer record with the number of records

Postby shilpakhaire » Fri Apr 03, 2009 8:52 pm

Thanks Frank! Some time later should be fine:)

Shilpa
shilpakhaire
 
Posts: 17
Joined: Fri Oct 31, 2008 9:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Matchingthe trailer record with the number of records

Postby shilpakhaire » Fri Apr 03, 2009 9:28 pm

I am trying to achieve only the record count match as below:
//PS000010 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=DW3T.RTLECR.GMAC.MNTHLY.XTRCT.SML,DISP=SHR
//OUT DD DSN=DW3T.RECRIS.GMAC.AUD,
// DISP=(NEW,CATLG,DELETE),
// UNIT=(,30),
// SPACE=(TRK,(1,1)),
// DCB=(DSORG=PS,RECFM=FB,LRECL=42,BLKSIZE=0)
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,30,SEQNUM,12,ZD,START=0)
OUTFIL FNAMES=OUT,NULLOFL=RC4,
INCLUDE=(1,07,CH,EQ,C'TRAILER',AND,
(18,12,ZD,EQ,31,12,ZD))

It gives me an RC=4 with this in spool:
OUT : DATA RECORDS OUT 0; TOTAL RECORDS OUT 0
Not sure why it is not selecting the records
shilpakhaire
 
Posts: 17
Joined: Fri Oct 31, 2008 9:53 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post