Need help to compare 2 files and write the matched records



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

Need help to compare 2 files and write the matched records

Postby pgoe9 » Wed Mar 30, 2011 5:30 pm

Hi,

I have 2 files. First file (Input1) having only 1 record is of 8 bytes containing the date in YYYYMMDD format. The second input file (Input2) having many records is of 107 bytes. This 2nd input file (Input2) contains the date from the column 100 to 107.

I need to compare both these files on the dates value and if the date matches then I need to copy all the contents from file 2 (input2) from column 1 to 99 in my output file.

For example: INPUT1
20110110

INPUT2
emp no1, name1, address,.........20110101
emp no2, name2, address,.........20110211
emp no3, name3, address,.........20110110

OUTPUT
emp no3, name3, address,.........

The JCL that I have coded is as follows:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=Input 1,DISP=SHR  --> file of 8 bytes
//SORTJNF2 DD DSN=Input 2,DISP=SHR  --> file of 107 bytes
//SORTOUT DD DSN=Output,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(230,4),RLSE),
// DCB=(RECFM=FB,LRECL=99,BLKSIZE=990)
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(100,8,A)
JOINKEYS FILES=F2,FIELDS=(1,8,A)
REFORMAT FIELDS=(F1:1,99)
OPTION COPY
/*


However, I'm getting this error constantly:
1 SYNCSORT  3.7BR  TPF1  US PATENTS: 4210961,5117495, OTHER PAT. PEND. (C) 199861,5117495, OTHER PAT. PEND. (C) 1998 SYNCSORT INC. DATE=2011/089 TIME=07.25.38
                                              z/OS   1.0.0   CPU MODEL 2097
 SYSIN :
   JOINKEYS FILE=F1,FIELDS=(100,8,A)
   *
   JOINKEYS FILE=F2,FIELDS=(1,8,A)
   *
   REFORMAT FIELDS=(F1:1,99)
   *
   SORT FIELDS=COPY
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000

I also tried giving PGM=SYNCTOOL, but it failed with RC 0020.
Please help me wit this problem. I need this urgently
pgoe9
 
Posts: 5
Joined: Wed Mar 30, 2011 5:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need help to compare 2 files and write the matched records

 

Re: Need help to compare 2 files and write the matched recor

Postby NicC » Wed Mar 30, 2011 8:34 pm

If you need it urgently then I suggest you ask around in your office or hire someone. We do not do 'urgent', 'asap', 'now' etc. We do as and when we feel like/can. Have you searched for the other topics like this? - in fact I think it is exactly the same.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Need help to compare 2 files and write the matched recor

Postby pgoe9 » Thu Mar 31, 2011 10:34 am

Yes Nic. I searched this forum for the similar problem. However what I have understood is that my syntax and everything related to Syncsort is exactly the same as guided by your panel; however the solution is till not working. What I would like to know is with the version that I'm using, does syncsort/joinkeys have different format or way to be used?

I have posted the exact error too. Although I need your help desperately, however whenever you or anyone from your panel feel like, then please let me know your inputs.

Thanks.
pgoe9
 
Posts: 5
Joined: Wed Mar 30, 2011 5:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need help to compare 2 files and write the matched recor

Postby BillyBoyo » Thu Mar 31, 2011 11:53 am

Put at least one blank in front of your sort control cards.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Need help to compare 2 files and write the matched recor

Postby NicC » Thu Mar 31, 2011 11:54 pm

We don't have a 'panel' - we are all computer professionals with various statuses - employed, unemployed, retired, whatever. I, for example, am not working in IT at the moment and only have an hour or 2 each day in which to look at these requests - others have all day unless they have another life!
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Need help to compare 2 files and write the matched recor

Postby Robert Sample » Fri Apr 01, 2011 12:06 am

However what I have understood is that my syntax and everything related to Syncsort is exactly the same as guided by your panel; however the solution is till not working.
Not true -- if you paid any attention at all to the many SORT posts on this forum, you would have noticed that they have at least one space before the SORT commands -- yours start in column 1. They are not "exactly the same" -- not at all.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Need help to compare 2 files and write the matched recor

Postby pgoe9 » Fri Apr 01, 2011 11:56 am

Thanks Billy Boyo and Robert. I did try all the possible starting positions of the SORT commands by not leaving any space, by leaving 1 space, by leaving 2 spaces, 3 spaces... but its still showing the same error as pasted above in my previous email :(
pgoe9
 
Posts: 5
Joined: Wed Mar 30, 2011 5:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need help to compare 2 files and write the matched recor

Postby BillyBoyo » Fri Apr 01, 2011 12:08 pm

The output you are showing us does not match your input. You have "FILES" in input, "FILE" in output. OPTION COPY vs SORT FIELDS=COPY. Plus the spaces now in front of the control cards.

So, I don't think you can be showing us the current output. If this doesn't help you, post the input and output again, but making sure we are looking at the same thing.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Need help to compare 2 files and write the matched recor

Postby enrico-sorichetti » Fri Apr 01, 2011 12:30 pm

any frigging reason to have the same issue posted multiple times all over the net? :evil:

anyway seems that the syncsort version release whatever is pretty old
SYNCSORT 3.7BR TPF1 US PATENTS: 4210961,5117495, OTHER PAT. PEND. (C) 199861,5117495, OTHER PAT. PEND. (C) 1998 SYNCSORT INC
z/OS 1.0.0

vs a more current one
SYNCSORT FOR Z/OS 1.3.2.1R U.S. PATENTS: 4210961, 5117495 (C) 2007 SYNCSORT INC.

I guess that joinkeys would not be available at that time
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Need help to compare 2 files and write the matched recor

Postby pgoe9 » Fri Apr 01, 2011 12:41 pm

Thank You Enrico for pointing that out. So now since the version that I'm using is pretty old and joinkeys functionality is out of question, is there a way to still achieve the result by some other utility that might work?
pgoe9
 
Posts: 5
Joined: Wed Mar 30, 2011 5:25 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post