Comparing files and writing O/P accordingly



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

Comparing files and writing O/P accordingly

Postby gracemanoj » Thu Sep 03, 2009 6:31 pm

I have a requirement in which I have to compare today's and previous day's file.

The file LRECL is 479

If the record is new in today's file then I need to write to a output file of the same LRECL with a CODE 'A' in the 470th position. If a record in previous day's file is not present in the current file, then I need to check the purge file which is of the same LRECL and write to the same output file with the CODE 'D' in the 470th position only if the record is not present in the history file. Also if the record in previous day's file of the same key doesn't match with the record in today's file then the output file should be written with the Code 'C' in 470th position.

There will be no duplicates in the file. Also the keys will be the first 38 bytes

Also I want to display in the sysout the number of records added, deleted and changed. I posted this in the DFSORT forum but the suggestion given by them using ICETOOL uses WHEN=GROUP which is not supported by SYNCSORT.

Can you please let me know if this is possible in SYNCSORT? Your help is greatly appreciated
gracemanoj
 
Posts: 7
Joined: Mon Aug 31, 2009 11:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Comparing files and writing O/P accordingly

 

Re: Comparing files and writing O/P accordingly

Postby dick scherrer » Fri Sep 04, 2009 12:56 am

Hello,

uses WHEN=GROUP which is not supported by SYNCSORT
WHEN=GROUP is supported by Syncsort. . .

More importantly, which sort product is in use on your system? If you post the informational messages generated by any sort execution, we can determine which product is in use.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Comparing files and writing O/P accordingly

Postby gracemanoj » Fri Sep 04, 2009 10:00 am

I read in some previous message that sync sort will not support WHEN=GROUP. Below is the message which I get

SYNCSORT FOR Z/OS 1.3.0.2RI U.S. PATENTS: 4210961, 5117495 (C) 2007 SYNCS

SYNCSORT LICENSED FOR <X> LICE
CTL1CNTL :
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'HDR'),PUSH=(480:ID=2)),
*
IFTHEN=(WHEN=(480,2,ZD,EQ,1),OVERLAY=(480:C'11',39,441)),
IFTHEN=(WHEN=(480,2,ZD,EQ,2),OVERLAY=(480:C'22'))

OUTFIL FNAMES=OUT,IFOUTLEN=479,OMIT=(480,2,ZD,EQ,12,AND,
(39,256,CH,EQ,482,256,CH,AND,296,184,CH,EQ,739,184,CH)),
IFTHEN=(WHEN=(480,2,ZD,EQ,11),OVERLAY=(470:C'D')),
IFTHEN=(WHEN=(480,2,ZD,EQ,12),OVERLAY=(470:C'C')),
IFTHEN=(WHEN=(480,2,ZD,EQ,22),OVERLAY=(470:C'A'))
WER428I CALLER-PROVIDED IDENTIFIER IS "0001"
WER268A INREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
gracemanoj
 
Posts: 7
Joined: Mon Aug 31, 2009 11:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Comparing files and writing O/P accordingly

Postby dick scherrer » Fri Sep 04, 2009 11:32 pm

Hello,

Your release of Syncsort (1.3.0) is not at the level that supports when=group. This was included in 1.3.2 if i remember correctly.

Possibly, your system support people can upgrade to the proper level.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Comparing files and writing O/P accordingly

Postby gracemanoj » Sun Sep 06, 2009 10:23 pm

Is there a way to write a sync sort for the same requirement?
gracemanoj
 
Posts: 7
Joined: Mon Aug 31, 2009 11:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Comparing files and writing O/P accordingly

Postby dick scherrer » Tue Sep 08, 2009 1:51 am

Hello,

Yes - upgrade the software so it is current. . .

If your organization is unwilling to upgrade, some other alternative will be needed - possibly even writing code. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Comparing files and writing O/P accordingly

Postby arcvns » Tue Sep 15, 2009 12:33 am

Hi Dick,

I think a SyncSort JOIN would be sufficient for the above problem. I am away from office now. Will try to post a solution tomorrow.
Arun
User avatar
arcvns
 
Posts: 55
Joined: Sat Feb 28, 2009 12:36 am
Location: India
Has thanked: 0 time
Been thanked: 0 time

Re: Comparing files and writing O/P accordingly

Postby dick scherrer » Tue Sep 15, 2009 1:15 am

Hi Arun,

Thank you :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Comparing files and writing O/P accordingly

Postby arcvns » Fri Sep 18, 2009 8:33 pm

gracemanoj,

This is untested. May be you can give this a try.

//STEP0200 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTOUT  DD SYSOUT=*                                               
//SORTJNF1 DD DSN= Previous day's file (FB/479)
//SORTJNF2 DD DSN= Current day's file  (FB/479)
//SYSIN    DD *                                             
  JOINKEYS FILE=F1,FIELDS=(1,38,A)
  JOINKEYS FILE=F2,FIELDS=(1,38,A)
  JOIN UNPAIRED
  REFORMAT FIELDS=(F1:1,479,F2:1,479)                         
  INREC IFTHEN=(WHEN=(1,1,CH,EQ,C' '),BUILD=(480,469,C'A',950,9)),
        IFTHEN=(WHEN=(480,1,CH,EQ,C' '),BUILD=(1,469,C'D',471,9)),
        IFTHEN=(WHEN=(39,256,CH,NE,518,256,CH,OR,
                     295,185,CH,NE,774,185,CH),
                BUILD=(1,469,C'C',471,9))           
  SORT FIELDS=COPY
Arun
User avatar
arcvns
 
Posts: 55
Joined: Sat Feb 28, 2009 12:36 am
Location: India
Has thanked: 0 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post