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
 

 

Syncsort - Count records from two files n find difference

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - Count records from two files n find difference
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 Moderator


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

PostPosted: Thu Oct 21, 2010 11:24 pm    Post subject:
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    Post subject: Reply to: Count records from two files n find difference usi
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 Moderator


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

PostPosted: Fri Oct 22, 2010 1:06 am    Post subject:
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    Post subject: Reply to: Count records from two files n find difference usi
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

Site Director


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

PostPosted: Fri Oct 22, 2010 2:03 am    Post subject:
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    Post subject: Reply to: Syncsort - Count records from two files n find dif
Reply with quote

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

Site Director


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

PostPosted: Fri Oct 22, 2010 2:51 am    Post subject:
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    Post subject: Reply to: Syncsort - Count records from two files n find dif
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

Site Director


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

PostPosted: Fri Oct 22, 2010 9:20 am    Post subject:
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    Post subject: Reply to: Syncsort - Count records from two files n find dif
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: 2161
Location: @my desk

PostPosted: Fri Oct 22, 2010 5:05 pm    Post subject:
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

Site Director


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

PostPosted: Fri Oct 22, 2010 7:28 pm    Post subject: Reply to: Syncsort - Count records from two files n find dif
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    Post subject: Reply to: Syncsort - Count records from two files n find dif
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

Site Director


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

PostPosted: Fri Oct 22, 2010 11:58 pm    Post subject:
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    Post subject: Reply to: Syncsort - Count records from two files n find dif
Reply with quote

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

Site Director


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

PostPosted: Sat Oct 23, 2010 10:04 pm    Post subject: Reply to: Syncsort - Count records from two files n find dif
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: 2161
Location: @my desk

PostPosted: Sun Oct 24, 2010 10:02 pm    Post subject:
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

Site Director


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

PostPosted: Sun Oct 24, 2010 10:57 pm    Post subject: Reply to: Syncsort - Count records from two files n find dif
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm


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