|
View previous topic :: View next topic
|
| Author |
Message |
jctgf Currently Banned Active User
Joined: 04 Nov 2006 Posts: 109
|
|
|
|
hi there,
i'd like to compare 2 files and write an output file containing only one column with all the unpaired keys in both files.
i'd would like a file like this:
the code below produces a file with 2 columns, like this:
| Code: |
AAA***
***CCC
***EEE
|
| Code: |
//*---------------------------------------------------------------------
//SORT EXEC PGM=SORT,REGION=40M
//SYSOUT DD SYSOUT=*
//$ORTPARM DD DSN=CARDLIB(EVTSRT01),DISP=SHR
//SORTJNF1 DD *
AAA5
BBB6
//SORTJNF2 DD *
BBB9
CCC8
EEE0
//SORTOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,3,A),SORTED
JOINKEYS FILE=F2,FIELDS=(1,3,A),SORTED
JOIN UNPAIRED,ONLY
REFORMAT FIELDS=(F1:1,3,F2:1,3),FILL=C'*'
|
is there a simple way to produce the file i need?
thanks. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT JOINKEYS job that will do what you asked for (you didn't show what's in the EVTSRT01 member, so I ignored it. If you need something in there, show what you need.
| Code: |
//SORT EXEC PGM=SORT,REGION=40M
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD *
AAA5
BBB6
//SORTJNF2 DD *
BBB9
CCC8
EEE0
//SORTOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,3,A),SORTED
JOINKEYS FILE=F2,FIELDS=(1,3,A),SORTED
JOIN UNPAIRED,ONLY
REFORMAT FIELDS=(F1:1,3,F2:1,3,?)
OPTION COPY
OUTFIL IFTHEN=(WHEN=(7,1,CH,EQ,C'1'),BUILD=(1,3)),
IFTHEN=(WHEN=(7,1,CH,EQ,C'2'),BUILD=(4,3))
/*
|
SORTOUT would have:
|
|
| Back to top |
|
 |
jctgf Currently Banned Active User
Joined: 04 Nov 2006 Posts: 109
|
|
|
|
Hi,
Thanks.
I have a few questions, please:
| Code: |
REFORMAT FIELDS=(F1:1,3,F2:1,3,?)
|
What's the purpose of the interrogation mark?
| Code: |
OUTFIL IFTHEN=(WHEN=(7,1,CH,EQ,C'1'),BUILD=(1,3)),
IFTHEN=(WHEN=(7,1,CH,EQ,C'2'),BUILD=(4,3)) |
I don't understand how the intermediate file would have 1 or 2 in column 7. Is it because of the interrogation mark?
Thanks again. |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
jctgf,
? indicates a 1-byte indicator is to be included in each joined record. The indicator will be set to one of the following values in each paired or unpaired joined record, as appropriate:
'B' - the key was found in F1 and F2.
'1' - the key was found in F1, but not in F2.
'2' - the key was found in F2, but not in F1.
This is explained in detail in here
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174 |
|
| Back to top |
|
 |
jctgf Currently Banned Active User
Joined: 04 Nov 2006 Posts: 109
|
|
|
|
hi,
I'm receiving the following syntax error:
| Code: |
Display Filter View Print Options Help
-------------------------------------------------------------------------------
DESA OUTPUT DISPLAY J9487777 JOB08967 DSID 108 LINE 1 COLUMNS 02- 81
COMMAND INPUT ===> SCROLL ===> CSR
SYNCSORT FOR Z/OS 1.3.2.1N U.S. PATENTS: 4210961, 5117495 (C) 2007 SYNCSO
z/OS 1.11.0
$ORTPARM : VSCORET=40M
OPTION MAINSIZE=40M
SYSIN :
JOINKEYS FILE=F1,FIELDS=(1,3,A),SORTED
JOINKEYS FILE=F2,FIELDS=(1,3,A),SORTED
JOIN UNPAIRED,ONLY
REFORMAT FIELDS=(F1:1,3,F2:1,3,?)
*
OPTION COPY
OUTFIL IFTHEN=(WHEN=(7,1,CH,EQ,C'1'),BUILD=(1,3)),
IFTHEN=(WHEN=(7,1,CH,EQ,C'2'),BUILD=(4,3))
WER903I SYNCSORT 1.3.2.1 IS NOT LICENSED FOR SERIAL 104AF, TYPE 2094 741, LPAR
WER903I PRODUCT WILL STOP WORKING IN 36 DAYS UNLESS A VALID KEY IS INSTALLED.
WER161B ALTERNATE PARM USED
WER268A REFORMAT STATEMENT: SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
******************************** BOTTOM OF DATA ******************************** |
thanks for any help. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Since you originally posted in the DFSORT Forum, we assumed you were using DFSORT and gave you a solution that works fine with DFSORT. However, the WER messages indicate you're using Syncsort, not DFSORT.
Please post Syncsort questions in the JCL Forum in the future. |
|
| Back to top |
|
 |
jctgf Currently Banned Active User
Joined: 04 Nov 2006 Posts: 109
|
|
|
|
ok.
usually, the syntax is the same.
| Code: |
//SORTJNF1 DD *
AAA5
BBB6
//SORTJNF2 DD *
BBB9
CCC8
EEE0
//SORTOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,3,A),SORTED
JOINKEYS FILE=F2,FIELDS=(1,3,A),SORTED
JOIN UNPAIRED,ONLY
REFORMAT FIELDS=(F1:1,3,F2:1,3),FILL=C'*'
SORT FIELDS=(4,1,A),FORMAT=BI
OUTFIL IFTHEN=(WHEN=(1,3,CH,EQ,C'***'),BUILD=(4,3)),
IFTHEN=(WHEN=(4,3,CH,EQ,C'***'),BUILD=(1,3))
|
In syncsort I did like this, but I wonder if there's a better way.
thanks. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
| usually, the syntax is the same. |
Not in this case. DFSORT supports the ? for the indicator. Syncsort does not. |
|
| Back to top |
|
 |
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
| Quote: |
usually, the syntax is the same.
|
Should this be translated to? 'Thank you so much for spending your own free time on this. I am so sorry I wasted your time.'
| Quote: |
could someone tell me how to do this via syncsort, please?
|
Should this be translated to? 'Eventhough the syntax is the same, and I could probably take this from here... Could someone else please do my work for me?' |
|
| Back to top |
|
 |
somunote
New User
Joined: 23 Jan 2010 Posts: 7 Location: Toronto
|
|
|
|
| Quote: |
| Should this be translated to? 'Eventhough the syntax is the same, and I could probably take this from here... Could someone else please do my work for me?' |
no, your interpretation is mistaken.
i've posted a solution (didn't you see?) that works, but would like to know if some one else has a better suggestion.
that's all.
thanks. |
|
| Back to top |
|
 |
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
The post had been edited while I was posting my reply?
You, somunote, or jctgf, which ever you are, made the change in the post.
I am glad you found your solution.
You see, the issue is bigger than just your post.
Many people, especially in the DFSORT/Syncsort realm, do not take the time to post enough information.
Frank and Kolusu, spend alot of time providing DFSORT solutions.
When it doesn't work because the OP has Syncsort, the OP thinks nothing of it.
The time those guys (and others) spend doing other peoples work for them (for which they get paid), is taken totally for granted.
Then they ask for a Syncsort solution. |
|
| Back to top |
|
 |
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Here is a SyncSort for z/OS JOIN application that will produce the requested output:
| Code: |
//SORT EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD *
AAA5
BBB6
//SORTJNF2 DD *
BBB9
CCC8
EEE0
//SORTOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,3,A),SORTED
JOINKEYS FILE=F2,FIELDS=(1,3,A),SORTED
JOIN UNPAIRED,ONLY
SORT FIELDS=COPY
OUTREC BUILD=(5,3),VTOF
/* |
|
|
| Back to top |
|
 |
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
Hi,
As in previous post you are getting output as
AAA
CCC
EEE
But i want only in my output as AAA only from file-1. none of unpaired records from file-2 should be present in the output file.
May you please help? |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10900 Location: italy
|
|
|
|
after 100 posts You should know how ...
| Quote: |
Start NewTopic
Start a new topic to post your queries. Do not ask your doubts as a reply to another post. Posts are to be made in relevant category/Forum. If you can't find one, post in Other Mainframe topics(e.g. Do not post SQL queries in COBOL Forum). |
and tagging questions to a 1 year old topic will not help either |
|
| Back to top |
|
 |
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
krunalbafna,
I agree with Enrico, however, the solution to your inquiry is quite simple. Modify the JOIN statement as follows:
| Code: |
JOIN UNPAIRED,F1,ONLY |
This should produce the output you desire. |
|
| Back to top |
|
 |
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
Thanks a lot.
I knew I have to post a new topic. But as the issue was similar and i was referring the above post, thought of posting it here.
thanks for the suggestion. I shall keep this in mind. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|