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

Need SYNCSORT to compare two files


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Tue Apr 21, 2009 4:06 pm
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
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 Developer


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

PostPosted: Tue Apr 21, 2009 8:51 pm
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
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 Developer


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

PostPosted: Tue Apr 21, 2009 9:06 pm
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
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 Developer


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

PostPosted: Tue Apr 21, 2009 9:54 pm
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
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 Developer


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

PostPosted: Wed Apr 22, 2009 1:35 am
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
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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Wed Apr 22, 2009 6:35 pm
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
Reply with quote

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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Wed Apr 22, 2009 6:54 pm
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: 2146
Location: At my coffee table

PostPosted: Wed Apr 22, 2009 6:56 pm
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: 2146
Location: At my coffee table

PostPosted: Wed Apr 22, 2009 7:04 pm
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 Developer


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

PostPosted: Wed Apr 22, 2009 9:18 pm
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
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 Developer


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

PostPosted: Wed Apr 22, 2009 9:57 pm
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
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
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Apr 22, 2009 10:07 pm
Reply with quote

Hello,

So, have you changed it back. . .?

What happens?
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:14 pm
Reply with quote

When I changed it 60 Step 1 Executed fine...but am getting problem in step 2.

Code:
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
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: Wed Apr 22, 2009 10:15 pm
Reply with quote

Quote:
I got below error message.


What error message? I don't see one. All I see are B and I (informational) messages - no A (error) message. The SYMNAMES file must have RECFM=FB and LRECL=80 so you can't use 60. That's the reason for the error in step 2.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Wed Apr 22, 2009 10:17 pm
Reply with quote

CICS Guy wrote:
How about posting the entire sysout?
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:23 pm
Reply with quote

SYSout is here...

Code:
$HASP373 SZRYDLJ  STARTED - INIT 1    - CLASS D - SYS S21                     
ACF9CCCD USERID SZRYDL   IS ASSIGNED TO THIS JOB - SZRYDLJ                     
IEF403I SZRYDLJ - STARTED - TIME=06.48.05                                     
MVS0010I SZRYDLJ  09.112 D          S1       ** R0000 **                       
IEC141I 013-20,IGG0191A,SZRYDLJ,S2,SYMNAMES,47B9,RMP010,SYS09112.T064805.RA000.
+WER999A SZRYDLJ ,S2      ,        -  UNSUCCESSFUL SORT 013 S REASON=00000020 
OPS4320H SZRYDLJ  OPSS *LOCAL* AOF VERB ENABLE           COMMAND ENABLE *DYNAMIIC.DMPCNT
IEA995I SYMPTOM DUMP OUTPUT  270                                               
SYSTEM COMPLETION CODE=013  REASON CODE=00000020                               
 TIME=06.48.06  SEQ=00209  CPU=0000  ASID=0174                                 
 PSW AT TIME OF ERROR  075C1000   80D7D7DE  ILC 2  INTC 0D                     
   NO ACTIVE MODULE FOUND                                                     
   NAME=UNKNOWN           
IEF450I SZRYDLJ S2 - ABEND=S013 U0000 REASON=00000020  273
        TIME=06.48.06                                     
MVS0010I SZRYDLJ  09.112 D          S2       ** S013  **           
                                           
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 Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top