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

Syncsort - Count records from two files n find difference


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Preetha Pree

New User


Joined: 21 Oct 2010
Posts: 8

PostPosted: Thu Oct 21, 2010 10:55 pm
Reply with quote

Hi,

Can someone help me on this requirement.

1. Count records from two different files
2. Find difference between two files, if difference is < 10 then I can proceed with next steps else I should abend the job.

Suppose counts are in a dataset as

6451
6440

Then I need to find difference in these counts.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Oct 21, 2010 11:24 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will count the records in both files and give RC=0 if the difference is < 10 or RC=16 if the difference is >= 10.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input file1
//IN2 DD DSN=...  input file2
//CT DD DSN=&&CT,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(MOD,PASS)
//OUT DD DUMMY
//TOOLIN DD *
COPY FROM(IN1) USING(CTL1)
COPY FROM(IN2) USING(CTL2)
COPY FROM(CT) TO(OUT) USING(CTL3)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=CT,REMOVECC,NODETAIL,
    TRAILER1=(1:COUNT=(TO=ZD,LENGTH=8))
/*
//CTL2CNTL DD *
  OUTFIL FNAMES=CT,REMOVECC,NODETAIL,
    TRAILER1=(11:COUNT=(TO=ZD,LENGTH=8))
/*
//CTL3CNTL DD *
  INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(1:1,8)),
    IFTHEN=(WHEN=(11,8,CH,NE,C' '),
      OVERLAY=(21:1,8,ZD,SUB,11,8,ZD,TO=ZD,LENGTH=8))
  OUTFIL FNAMES=OUT,NULLOFL=RC16,OMIT=(21,8,CH,EQ,C' ',OR,
   (21,8,CH,NE,C' ',AND,21,8,ZD,GE,+10))
/*
Back to top
View user's profile Send private message
Preetha Pree

New User


Joined: 21 Oct 2010
Posts: 8

PostPosted: Fri Oct 22, 2010 12:40 am
Reply with quote

Thank you Frank!

But am getting Syntax error:

Thanks Frank!

But am getting INREC SYntax error


INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(1:1,8)),
*
IFTHEN=(WHEN=(11,8,CH,NE,C' '),
OVERLAY=(21:1,8,ZD,SUB,11,8,ZD,TO=ZD,LENGTH=8)
OUTFIL FNAMES=OUT1,NULLOFL=RC16,OMIT=(21,8,CH,EQ,C' ',OR,
(21,8,CH,NE,C' ',AND,21,8,ZD,GE,+10))

WER428I CALLER-PROVIDED IDENTIFIER IS "0003"
WER268A INREC STATEMENT : SYNTAX ERROR
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Oct 22, 2010 1:06 am
Reply with quote

The job works fine with DFSORT. The WER messages indicate you're using Syncsort, not DFSORT. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
Back to top
View user's profile Send private message
Preetha Pree

New User


Joined: 21 Oct 2010
Posts: 8

PostPosted: Fri Oct 22, 2010 1:33 am
Reply with quote

Please help on the below error

INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(1:1,8)),
*
IFTHEN=(WHEN=(11,8,CH,NE,C' '),
OVERLAY=(21:1,8,ZD,SUB,11,8,ZD,TO=ZD,LENGTH=8)
OUTFIL FNAMES=OUT1,NULLOFL=RC16,OMIT=(21,8,CH,EQ,C' ',OR,
(21,8,CH,NE,C' ',AND,21,8,ZD,GE,+10))

WER428I CALLER-PROVIDED IDENTIFIER IS "0003"
WER268A INREC STATEMENT : SYNTAX ERROR


Someone please help
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Oct 22, 2010 2:03 am
Reply with quote

Hello,

Which release of Syncsort is being used? This is shown at the top of the informational output generated by a run.
Back to top
View user's profile Send private message
Preetha Pree

New User


Joined: 21 Oct 2010
Posts: 8

PostPosted: Fri Oct 22, 2010 2:28 am
Reply with quote

SYNCTOOL RELEASE 1.5.3 - COPYRIGHT 2004 SYNCSORT INC
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Oct 22, 2010 2:51 am
Reply with quote

Hello,

What happens if you run your process using sort rather than synctool?

Show which release of the sort (rather than synctool) is invoked when you try this.
Back to top
View user's profile Send private message
Preetha Pree

New User


Joined: 21 Oct 2010
Posts: 8

PostPosted: Fri Oct 22, 2010 8:34 am
Reply with quote

Hi,

Please find below

SYNCSORT FOR Z/OS 1.2.3.1NI
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Oct 22, 2010 9:20 am
Reply with quote

Hello,

Your product release is not current.

WHEN=GROUP is available in the current release.
Back to top
View user's profile Send private message
Preetha Pree

New User


Joined: 21 Oct 2010
Posts: 8

PostPosted: Fri Oct 22, 2010 9:41 am
Reply with quote

1. Count records from two different files
2. Find difference between two files, if difference is < 10 then I can proceed with next steps else I should abend the job.

Suppose counts are in a dataset as

6451
6440

Then I need to find difference in these counts.


Can you help me how this can be accomplished with this vesion
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Oct 22, 2010 5:05 pm
Reply with quote

Preetha,

You can try this SYNCTOOL alternative.
Code:
//STEP01 EXEC PGM=SYNCTOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//IN1      DD DSN=...  input file1
//IN2      DD DSN=...  input file2
//T1       DD DSN=&T1,DISP=(,PASS),UNIT=SYSDA
//T2       DD DSN=&T2,DISP=(,PASS),UNIT=SYSDA
//TOOLIN   DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T2) USING(CTL1)
//CTL1CNTL DD *
  OUTFIL REMOVECC,NODETAIL,
  TRAILER1=('CNT1,+',COUNT=(M11,LENGTH=8),80:X)
//STEP02 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=&T1,DISP=(SHR,PASS)
//SYMNAMES DD DSN=&T2,DISP=(SHR,PASS)
//OUT      DD DUMMY
//SYSIN    DD *
  OPTION COPY
  INREC BUILD=(7,8,ZD,SUB,CNT1,M11,LENGTH=8)
  OUTFIL FNAMES=OUT,INCLUDE=(1,8,ZD,LT,10),NULLOFL=RC4
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Oct 22, 2010 7:28 pm
Reply with quote

Hi Arun,

Thanks for keeping an eye on us icon_smile.gif

d
Back to top
View user's profile Send private message
Preetha Pree

New User


Joined: 21 Oct 2010
Posts: 8

PostPosted: Fri Oct 22, 2010 11:35 pm
Reply with quote

Hi,

I am getting below error... please help

Code:
IEC141I 013-20,IGG0191A,DLPXV1R,STEP040,SYMNAMES,VIO ,      ,SYS10295.T135916.RA
+WER999A DLPXV1R ,STEP040 ,        -  UNSUCCESSFUL SORT 013 S REASON=00000020   
IEA995I SYMPTOM DUMP OUTPUT  696                                               
SYSTEM COMPLETION CODE=013  REASON CODE=00000020                               
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Oct 22, 2010 11:58 pm
Reply with quote

Hello,

Incorrect dcb parameter(s) specified.
Back to top
View user's profile Send private message
Preetha Pree

New User


Joined: 21 Oct 2010
Posts: 8

PostPosted: Sat Oct 23, 2010 1:47 pm
Reply with quote

Thank you its working fine.. icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Sat Oct 23, 2010 10:04 pm
Reply with quote

Good to hear it is workng - thank you for letting us know icon_smile.gif

d
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Sun Oct 24, 2010 10:02 pm
Reply with quote

Hi Dick,

Thanks for the follow up. I thought I messed up the syntax somewhere as our security policies don't allow to "copy" the jcl.(Lot of typing required) icon_evil.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Sun Oct 24, 2010 10:57 pm
Reply with quote

Hi Arun,

Quote:
our security policies don't allow to "copy" the jcl

Because i'm such a terrible typist these days, i make a local copy and edit out the site-specific content which conceals dsns, ids, ip addresses, etc icon_smile.gif

d
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts 3 files concatenated to 1 DFSORT/ICETOOL 2
No new posts Syncsort help SYNCSORT 3
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts Difference between joblib and steplib JCL & VSAM 2
Search our Forums:

Back to Top