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
 

 

Need SYNCSORT to compare two files
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
charavind17

New User


Joined: 24 Sep 2008
Posts: 30
Location: chennai

PostPosted: Tue Apr 21, 2009 3:06 pm    Post subject: Need SYNCSORT to compare two files
Reply with quote

i have two files A and B. A is input file and B is output file. B will have the last processed sequence number. So the next time when we revieve A file it will have new sequence number and that to it should be 1 greater then the last processed file. we need to check this condition.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Apr 21, 2009 4:06 pm    Post subject:
Reply with quote

The files are FB / VB ?
The LRECL is ?
The position to check, and its length is ?
The format of the check variable is Character / Numeric / Packed ?
Back to top
View user's profile Send private message
charavind17

New User


Joined: 24 Sep 2008
Posts: 30
Location: chennai

PostPosted: Tue Apr 21, 2009 5:08 pm    Post subject: Reply to: Need sort card to compare two files
Reply with quote

The files are of FB.
LRECL of A file is 161 and LRECL for B file is 60.

Position to check for A file is 70 to 74 and it is also numeric field and A file is having one header one trailer.
Position to check from B file is 11 to 14 and it is numeric field. B file is having only one record.


The format of the check variable is Numeric.
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: Tue Apr 21, 2009 8:51 pm    Post subject:
Reply with quote

Quote:
we need to check this condition


And do what if it's true? And do what if it's false?
Back to top
View user's profile Send private message
charavind17

New User


Joined: 24 Sep 2008
Posts: 30
Location: chennai

PostPosted: Tue Apr 21, 2009 8:56 pm    Post subject: Reply to: Need sort card to compare two files
Reply with quote

if A file sequence number is one greater then B file sequence number then we need to process the A file....and if it does not satisfy then we need to send a mail for sending correct file...
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: Tue Apr 21, 2009 9:06 pm    Post subject:
Reply with quote

So I assume that a zero or non-zero return code you could test would do the trick - right?

Quote:

Position to check for A file is 70 to 74 ...
Position to check from B file is 11 to 14


70-74 is 5 bytes whereas 11-14 is 4 bytes. Are the fields you want to compare really different lengths or did you get the positions wrong for one of them?
Back to top
View user's profile Send private message
charavind17

New User


Joined: 24 Sep 2008
Posts: 30
Location: chennai

PostPosted: Tue Apr 21, 2009 9:45 pm    Post subject: Reply to: Need sort card to compare two files
Reply with quote

yes..

Sorry..its from 70 to 73 position...4 bytes..
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: Tue Apr 21, 2009 9:54 pm    Post subject:
Reply with quote

Ok, now I realize I don't know which record in fileA has the numeric field you want to check in positions 70-73. Is it the last record in the file or another record? Does that record have an identifier (e.g. C'TRL' in positions 1-3).

Actually, could you please show an example of the records in each input file for the case where the check is true and the case where the check is false.
Back to top
View user's profile Send private message
charavind17

New User


Joined: 24 Sep 2008
Posts: 30
Location: chennai

PostPosted: Tue Apr 21, 2009 11:18 pm    Post subject: Reply to: Need sort card to compare two files
Reply with quote

A file is shown below:

Code:
AAAA                    ABC    HEADER FOR PROPOSED ORDER FILE200904218160IX
999999999999999999999999Abc    TRAILER FOR PROPOSED ORD FILE 000000000X


B file is shown below:

Code:
MT1060CTL 8159 090421   CONTROL FILE - PROPOSED ORDER FEED


Now the file A is having seqeuence number as 8160 and file B is having sequence number as 8159.

A file sequencenumber is one greater then B file...this is correct condition...if this fails i need to send mail for asking correct file....
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: Wed Apr 22, 2009 1:35 am    Post subject:
Reply with quote

Here's a DFSORT job that will do what I think you asked for. You'll get RC=0 if the condition is true or RC=16 if the condition is false.

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input fileB (FB/60)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  INREC BUILD=(C'TARG,+',11,4,ZD,ADD,+1,TO=ZD,LENGTH=4,80:X)
/*
//S2    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input fileA (FB/161)
//SORTOUT DD DUMMY
//SYSIN    DD    *
  OPTION COPY,STOPAFT=1
  OUTFIL NULLOFL=RC16,INCLUDE=(70,4,ZD,EQ,TARG)
/*
Back to top
View user's profile Send private message
charavind17

New User


Joined: 24 Sep 2008
Posts: 30
Location: chennai

PostPosted: Wed Apr 22, 2009 5:56 pm    Post subject: Reply to: Need sort card to compare two files
Reply with quote

Code:
//S1    EXEC  PGM=SORT                                           
//SYSOUT    DD  SYSOUT=*                                         
//SORTIN DD DSN=UDEM.MTAR.MT1060C,DISP=SHR                       
//*SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(2,1)),DISP=(,PASS),
//SORTOUT DD DSN=UDEM.MTNK.MT1060C,                               
//           UNIT=SYSDA,SPACE=(TRK,(2,1)),DISP=(NEW,CATLG,DELETE),
//           DCB=(RECFM=FB,LRECL=60,BLKSIZE=4620)                 
//SYSIN    DD    *                                               
  OPTION COPY                                                     
  INREC BUILD=(C'TARG,+',11,4,ZD,ADD,+1,TO=ZD,LENGTH=4,60:X)     
/*                                                               
//S2    EXEC  PGM=SORT                                         
//SYSOUT    DD  SYSOUT=*                                         
//SYMNAMES DD DSN=UDEM.MTNK.MT1060C,DISP=(OLD,PASS)               
//*SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)                           
//SORTIN DD DSN=UDEM.MTAR.MT1060IS.TEST,DISP=SHR                 
//SORTOUT DD DUMMY                                               
//SYSIN    DD    *                                               
  OPTION COPY,STOPAFT=1                       
  OUTFIL NULLOFL=RC16,INCLUDE=(70,4,ZD,EQ,TARG)
/*                                             



But I am getting below error

MVS0010I SZRYDLL 09.112 D S1 ** R0000 **
IEC141I 013-20,IGG0191A,SZRYDLL,S2,SYMNAMES,4797,RMP002,UDEM.MTNK.MT1060C
+WER999A SZRYDLL ,S2 , - UNSUCCESSFUL SORT 013 S REASON=00000020


But also I am getting value in Sortout as TARG,+816C.

In A file i have given 8163 and in B file I have given as 8162.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 988
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Apr 22, 2009 6:35 pm    Post subject:
Reply with quote

Quote:
+WER999A SZRYDLL ,S2 , - UNSUCCESSFUL SORT 013 S REASON=00000020


This error message indicates that you are using SYNCSORT, not DFSORT.

Garry.
Back to top
View user's profile Send private message
charavind17

New User


Joined: 24 Sep 2008
Posts: 30
Location: chennai

PostPosted: Wed Apr 22, 2009 6:41 pm    Post subject:
Reply with quote

So what I should use instead of SORT here.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 988
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Apr 22, 2009 6:54 pm    Post subject:
Reply with quote

Frank supports IBM's DFSORT product, not SYNCSORT. You have posted your query is the DFSORT forum whereas you should have posted in thre JCL forum where SYNCSORT questions are posed/answered..

SYNCSORT may or may not have equivalent functionality to the solution Frank proposed for DFSORT.

Garry.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Apr 22, 2009 6:56 pm    Post subject:
Reply with quote

How about posting the entire sysout?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Apr 22, 2009 7:04 pm    Post subject:
Reply with quote

Quote:
But also I am getting value in Sortout as TARG,+816C.
You are aware that 816C is 8163 with a positive sign.
SyncSort for z/OS 1.3 Programmer’s Guide wrote:
The documentation accompanying WER999A varies with the error involved. It may consist of a standard system dump (SYSUDUMP or SYSABEND) and/or a SyncSort-generated SNAP dump. The SyncSort SNAP is formatted very much like a SYSUDUMP. In debugging the SNAP, care must be taken to avoid reliance on the PSW AT ENTRY TO SNAP and the general registers. (A SNAP dump produced through the SyncSort DEBUG PARM or with a W-abend (i.e., WER999A UNSUCCESSFUL SORT xxxW) is only useful to a sort analyst at SyncSort for z/OS Product Services.
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: Wed Apr 22, 2009 9:18 pm    Post subject:
Reply with quote

charavind17,

The job I posted works fine with DFSORT as I coded it. The job you posted is NOT the same as the job I posted and you are 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
charavind17

New User


Joined: 24 Sep 2008
Posts: 30
Location: chennai

PostPosted: Wed Apr 22, 2009 9:47 pm    Post subject: Reply to: Need SYNCSORT to compare two files
Reply with quote

Yaeger I have used the job which you posted....What is the diffrence in your job and my job...
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: Wed Apr 22, 2009 9:57 pm    Post subject:
Reply with quote

Quote:
Yaeger I have used the job which you posted


No, you didn't.

Quote:
What is the diffrence in your job and my job


My S1 SORTOUT file is 80 bytes - you changed it to 60 bytes - that makes a big difference.
Back to top
View user's profile Send private message
charavind17

New User


Joined: 24 Sep 2008
Posts: 30
Location: chennai

PostPosted: Wed Apr 22, 2009 10:03 pm    Post subject:
Reply with quote

But I used 80 bytes I got below error message.

Code:
  OPTION COPY                                                     
  INREC BUILD=(C'TARG,+',11,4,ZD,ADD,+1,TO=ZD,LENGTH=4,80:X)     
WER276B  SYSDIAG= 83708, 395508, 395508, 1125746                 
WER164B  6,896K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B     0 BYTES RESERVE REQUESTED, 1,025,480 BYTES USED       
WER146B  20K BYTES OF EMERGENCY SPACE ALLOCATED                   
WER108I  SORTIN   : RECFM=FB   ; LRECL=    60; BLKSIZE=  4620     
WER257I  INREC RECORD LENGTH =    80                             
WER238I  POTENTIALLY INEFFICIENT USE OF INREC                     
WER110I  SORTOUT  : RECFM=FB   ; LRECL=    80; BLKSIZE= 27920     



So i changed it to 60...
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 3 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 Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm


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