Syncsort - Write UNPAIRED records to SORTOUT file, and PAIRED records to PAIRED file
I'm able to save the UNPAIRED records to SORTOUT (this is what I want) using the following:
//SORT EXEC PGM=SORT,PARM='DYNALLOC=(SYSDA,255)'
//SORTMSGS DD SYSOUT=*
//SORTJNF1 DD DSN=FILE1,
// DISP=OLD,DCB=BUFNO=255
//SORTJNF2 DD DSN=FILE2,
// DISP=OLD,DCB=BUFNO=255
//SORTOUT DD DSN=FILEOUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=(SYSDA,59),
// SPACE=(CYL,(500,100),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILE=F1,FIELDS=(25,4,A,115,20,A,135,4,A,140,4,A,5,20,A)
JOINKEYS FILE=F2,FIELDS=(5,4,A,9,20,A,29,4,A,33,4,A,37,20,A)
JOIN UNPAIRED,F2,ONLY
but I need to save the PAIRED records to a separate file. I tried the following statement but the PAIRED records don't get saved in my PAIRED file:
//SORT EXEC PGM=SORT,PARM='DYNALLOC=(SYSDA,255)'
//SORTMSGS DD SYSOUT=*
//SORTJNF1 DD DSN=FILE.F1,
// DISP=OLD,DCB=BUFNO=255
//SORTJNF2 DD DSN=FILE.F2,
// DISP=OLD,DCB=BUFNO=255
//SORTOUT DD DSN=FILE.SORTOUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=(SYSDA,59),
// SPACE=(CYL,(500,100),RLSE)
//PAIRED DD DSN=FILE.PAIRED,
// DISP=(NEW,CATLG,DELETE),
// UNIT=(SYSDA,59),
// SPACE=(CYL,(500,100),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILE=F1,FIELDS=(25,4,A,115,20,A,135,4,A,140,4,A,5,20,A)
JOINKEYS FILE=F2,FIELDS=(5,4,A,9,20,A,29,4,A,33,4,A,37,20,A)
JOIN UNPAIRED,F2,ONLY
OUTFIL FNAMES=SORTOUT
OUTFIL FNAMES=PAIRED,SAVE
syncsort
add a comment |
I'm able to save the UNPAIRED records to SORTOUT (this is what I want) using the following:
//SORT EXEC PGM=SORT,PARM='DYNALLOC=(SYSDA,255)'
//SORTMSGS DD SYSOUT=*
//SORTJNF1 DD DSN=FILE1,
// DISP=OLD,DCB=BUFNO=255
//SORTJNF2 DD DSN=FILE2,
// DISP=OLD,DCB=BUFNO=255
//SORTOUT DD DSN=FILEOUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=(SYSDA,59),
// SPACE=(CYL,(500,100),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILE=F1,FIELDS=(25,4,A,115,20,A,135,4,A,140,4,A,5,20,A)
JOINKEYS FILE=F2,FIELDS=(5,4,A,9,20,A,29,4,A,33,4,A,37,20,A)
JOIN UNPAIRED,F2,ONLY
but I need to save the PAIRED records to a separate file. I tried the following statement but the PAIRED records don't get saved in my PAIRED file:
//SORT EXEC PGM=SORT,PARM='DYNALLOC=(SYSDA,255)'
//SORTMSGS DD SYSOUT=*
//SORTJNF1 DD DSN=FILE.F1,
// DISP=OLD,DCB=BUFNO=255
//SORTJNF2 DD DSN=FILE.F2,
// DISP=OLD,DCB=BUFNO=255
//SORTOUT DD DSN=FILE.SORTOUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=(SYSDA,59),
// SPACE=(CYL,(500,100),RLSE)
//PAIRED DD DSN=FILE.PAIRED,
// DISP=(NEW,CATLG,DELETE),
// UNIT=(SYSDA,59),
// SPACE=(CYL,(500,100),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILE=F1,FIELDS=(25,4,A,115,20,A,135,4,A,140,4,A,5,20,A)
JOINKEYS FILE=F2,FIELDS=(5,4,A,9,20,A,29,4,A,33,4,A,37,20,A)
JOIN UNPAIRED,F2,ONLY
OUTFIL FNAMES=SORTOUT
OUTFIL FNAMES=PAIRED,SAVE
syncsort
add a comment |
I'm able to save the UNPAIRED records to SORTOUT (this is what I want) using the following:
//SORT EXEC PGM=SORT,PARM='DYNALLOC=(SYSDA,255)'
//SORTMSGS DD SYSOUT=*
//SORTJNF1 DD DSN=FILE1,
// DISP=OLD,DCB=BUFNO=255
//SORTJNF2 DD DSN=FILE2,
// DISP=OLD,DCB=BUFNO=255
//SORTOUT DD DSN=FILEOUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=(SYSDA,59),
// SPACE=(CYL,(500,100),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILE=F1,FIELDS=(25,4,A,115,20,A,135,4,A,140,4,A,5,20,A)
JOINKEYS FILE=F2,FIELDS=(5,4,A,9,20,A,29,4,A,33,4,A,37,20,A)
JOIN UNPAIRED,F2,ONLY
but I need to save the PAIRED records to a separate file. I tried the following statement but the PAIRED records don't get saved in my PAIRED file:
//SORT EXEC PGM=SORT,PARM='DYNALLOC=(SYSDA,255)'
//SORTMSGS DD SYSOUT=*
//SORTJNF1 DD DSN=FILE.F1,
// DISP=OLD,DCB=BUFNO=255
//SORTJNF2 DD DSN=FILE.F2,
// DISP=OLD,DCB=BUFNO=255
//SORTOUT DD DSN=FILE.SORTOUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=(SYSDA,59),
// SPACE=(CYL,(500,100),RLSE)
//PAIRED DD DSN=FILE.PAIRED,
// DISP=(NEW,CATLG,DELETE),
// UNIT=(SYSDA,59),
// SPACE=(CYL,(500,100),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILE=F1,FIELDS=(25,4,A,115,20,A,135,4,A,140,4,A,5,20,A)
JOINKEYS FILE=F2,FIELDS=(5,4,A,9,20,A,29,4,A,33,4,A,37,20,A)
JOIN UNPAIRED,F2,ONLY
OUTFIL FNAMES=SORTOUT
OUTFIL FNAMES=PAIRED,SAVE
syncsort
I'm able to save the UNPAIRED records to SORTOUT (this is what I want) using the following:
//SORT EXEC PGM=SORT,PARM='DYNALLOC=(SYSDA,255)'
//SORTMSGS DD SYSOUT=*
//SORTJNF1 DD DSN=FILE1,
// DISP=OLD,DCB=BUFNO=255
//SORTJNF2 DD DSN=FILE2,
// DISP=OLD,DCB=BUFNO=255
//SORTOUT DD DSN=FILEOUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=(SYSDA,59),
// SPACE=(CYL,(500,100),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILE=F1,FIELDS=(25,4,A,115,20,A,135,4,A,140,4,A,5,20,A)
JOINKEYS FILE=F2,FIELDS=(5,4,A,9,20,A,29,4,A,33,4,A,37,20,A)
JOIN UNPAIRED,F2,ONLY
but I need to save the PAIRED records to a separate file. I tried the following statement but the PAIRED records don't get saved in my PAIRED file:
//SORT EXEC PGM=SORT,PARM='DYNALLOC=(SYSDA,255)'
//SORTMSGS DD SYSOUT=*
//SORTJNF1 DD DSN=FILE.F1,
// DISP=OLD,DCB=BUFNO=255
//SORTJNF2 DD DSN=FILE.F2,
// DISP=OLD,DCB=BUFNO=255
//SORTOUT DD DSN=FILE.SORTOUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=(SYSDA,59),
// SPACE=(CYL,(500,100),RLSE)
//PAIRED DD DSN=FILE.PAIRED,
// DISP=(NEW,CATLG,DELETE),
// UNIT=(SYSDA,59),
// SPACE=(CYL,(500,100),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILE=F1,FIELDS=(25,4,A,115,20,A,135,4,A,140,4,A,5,20,A)
JOINKEYS FILE=F2,FIELDS=(5,4,A,9,20,A,29,4,A,33,4,A,37,20,A)
JOIN UNPAIRED,F2,ONLY
OUTFIL FNAMES=SORTOUT
OUTFIL FNAMES=PAIRED,SAVE
syncsort
syncsort
asked Nov 22 '18 at 18:56
user3489502user3489502
1,14622040
1,14622040
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Edit 1: OP has mentioned (in the comments section of this answer), "I only want to keep the UNPAIRED records (F2 only) in my main SORTOUT dataset, and the PAIRED records (F2 only) in my PAIRED dataset." Paired records mean both F1 & F2. OP is basically looking for RIGHT JOIN. The SORT statements provided below are edited as per OP's requirement. Note that a REFORMAT statement is required unless a JOIN statement with the ONLY operand is specified.
You must use a method in Syncsort (which is called as indicator method in dfsort), to acheive what you're expecting. See below SORT statements.
SORT FIELDS=COPY
JOINKEYS FILE=F1,FIELDS=(25,4,A,115,20,A,135,4,A,140,4,A,5,20,A)
JOINKEYS FILE=F2,FIELDS=(5,4,A,9,20,A,29,4,A,33,4,A,37,20,A)
REFORMAT FIELDS=(F1:p,l,F2:p,l,?)
JOIN UNPAIRED,F2
OUTFIL FNAMES=BOTH,INCLUDE=(53,1,CH,EQ,C'B'),BUILD=(Build the columns you need from F1/F2)
OUTFIL FNAMES=UNPAIRED,INCLUDE=(53,1,CH,EQ,C'2'),BUILD=(Build the columns you need from F2)
where,
p - The position value indicates the first byte of the field relative to the beginning of the input record.
l - The length value indicates the length of the field.
Observe the ? in the REFORMAT FIELDS statement.
Quote from Syncsort for z/OS Programmer's guide:
?
This symbol is used to place a one-byte indicator in the reformatted
record that indicates whether the reformatted record is a paired or an
unpaired joined record. The indicator will be set to one of three
different printable values:
“B” if the reformatted record is a paired
record
“1” if the reformatted record is an unpaired record created
from the F1 file
“2” if the reformatted record is an unpaired record
created from the F2 file
More details:
Paired and unpaired F1/F2 records (indicator method).
Syncsort for z/OS Programmer's guide.
Hope this helps!
Thanks. I don't need/want to reformat/include specific records. I only want to keep the UNPAIRED records (F2 only) in my main SORTOUT dataset, and the PAIRED records (F2 only) in my PAIRED dataset.
– user3489502
Nov 23 '18 at 13:31
Ok! Basically you're looking for a RIGHT JOIN.JOIN UNPAIRED,F2,ONLYas you coded in your SORT statement will fetch F2 records that do not have a match in F1 on the specified keys. Consider codingJOIN UNPAIRED,F2which will fetch matching records from F1 and F2 + Non Matching records from F2. AREFORMATstatement is required unless a JOIN statement with the ONLY operand is specified.
– Srinivasan Jv
Nov 23 '18 at 14:03
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53436760%2fsyncsort-write-unpaired-records-to-sortout-file-and-paired-records-to-paired%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Edit 1: OP has mentioned (in the comments section of this answer), "I only want to keep the UNPAIRED records (F2 only) in my main SORTOUT dataset, and the PAIRED records (F2 only) in my PAIRED dataset." Paired records mean both F1 & F2. OP is basically looking for RIGHT JOIN. The SORT statements provided below are edited as per OP's requirement. Note that a REFORMAT statement is required unless a JOIN statement with the ONLY operand is specified.
You must use a method in Syncsort (which is called as indicator method in dfsort), to acheive what you're expecting. See below SORT statements.
SORT FIELDS=COPY
JOINKEYS FILE=F1,FIELDS=(25,4,A,115,20,A,135,4,A,140,4,A,5,20,A)
JOINKEYS FILE=F2,FIELDS=(5,4,A,9,20,A,29,4,A,33,4,A,37,20,A)
REFORMAT FIELDS=(F1:p,l,F2:p,l,?)
JOIN UNPAIRED,F2
OUTFIL FNAMES=BOTH,INCLUDE=(53,1,CH,EQ,C'B'),BUILD=(Build the columns you need from F1/F2)
OUTFIL FNAMES=UNPAIRED,INCLUDE=(53,1,CH,EQ,C'2'),BUILD=(Build the columns you need from F2)
where,
p - The position value indicates the first byte of the field relative to the beginning of the input record.
l - The length value indicates the length of the field.
Observe the ? in the REFORMAT FIELDS statement.
Quote from Syncsort for z/OS Programmer's guide:
?
This symbol is used to place a one-byte indicator in the reformatted
record that indicates whether the reformatted record is a paired or an
unpaired joined record. The indicator will be set to one of three
different printable values:
“B” if the reformatted record is a paired
record
“1” if the reformatted record is an unpaired record created
from the F1 file
“2” if the reformatted record is an unpaired record
created from the F2 file
More details:
Paired and unpaired F1/F2 records (indicator method).
Syncsort for z/OS Programmer's guide.
Hope this helps!
Thanks. I don't need/want to reformat/include specific records. I only want to keep the UNPAIRED records (F2 only) in my main SORTOUT dataset, and the PAIRED records (F2 only) in my PAIRED dataset.
– user3489502
Nov 23 '18 at 13:31
Ok! Basically you're looking for a RIGHT JOIN.JOIN UNPAIRED,F2,ONLYas you coded in your SORT statement will fetch F2 records that do not have a match in F1 on the specified keys. Consider codingJOIN UNPAIRED,F2which will fetch matching records from F1 and F2 + Non Matching records from F2. AREFORMATstatement is required unless a JOIN statement with the ONLY operand is specified.
– Srinivasan Jv
Nov 23 '18 at 14:03
add a comment |
Edit 1: OP has mentioned (in the comments section of this answer), "I only want to keep the UNPAIRED records (F2 only) in my main SORTOUT dataset, and the PAIRED records (F2 only) in my PAIRED dataset." Paired records mean both F1 & F2. OP is basically looking for RIGHT JOIN. The SORT statements provided below are edited as per OP's requirement. Note that a REFORMAT statement is required unless a JOIN statement with the ONLY operand is specified.
You must use a method in Syncsort (which is called as indicator method in dfsort), to acheive what you're expecting. See below SORT statements.
SORT FIELDS=COPY
JOINKEYS FILE=F1,FIELDS=(25,4,A,115,20,A,135,4,A,140,4,A,5,20,A)
JOINKEYS FILE=F2,FIELDS=(5,4,A,9,20,A,29,4,A,33,4,A,37,20,A)
REFORMAT FIELDS=(F1:p,l,F2:p,l,?)
JOIN UNPAIRED,F2
OUTFIL FNAMES=BOTH,INCLUDE=(53,1,CH,EQ,C'B'),BUILD=(Build the columns you need from F1/F2)
OUTFIL FNAMES=UNPAIRED,INCLUDE=(53,1,CH,EQ,C'2'),BUILD=(Build the columns you need from F2)
where,
p - The position value indicates the first byte of the field relative to the beginning of the input record.
l - The length value indicates the length of the field.
Observe the ? in the REFORMAT FIELDS statement.
Quote from Syncsort for z/OS Programmer's guide:
?
This symbol is used to place a one-byte indicator in the reformatted
record that indicates whether the reformatted record is a paired or an
unpaired joined record. The indicator will be set to one of three
different printable values:
“B” if the reformatted record is a paired
record
“1” if the reformatted record is an unpaired record created
from the F1 file
“2” if the reformatted record is an unpaired record
created from the F2 file
More details:
Paired and unpaired F1/F2 records (indicator method).
Syncsort for z/OS Programmer's guide.
Hope this helps!
Thanks. I don't need/want to reformat/include specific records. I only want to keep the UNPAIRED records (F2 only) in my main SORTOUT dataset, and the PAIRED records (F2 only) in my PAIRED dataset.
– user3489502
Nov 23 '18 at 13:31
Ok! Basically you're looking for a RIGHT JOIN.JOIN UNPAIRED,F2,ONLYas you coded in your SORT statement will fetch F2 records that do not have a match in F1 on the specified keys. Consider codingJOIN UNPAIRED,F2which will fetch matching records from F1 and F2 + Non Matching records from F2. AREFORMATstatement is required unless a JOIN statement with the ONLY operand is specified.
– Srinivasan Jv
Nov 23 '18 at 14:03
add a comment |
Edit 1: OP has mentioned (in the comments section of this answer), "I only want to keep the UNPAIRED records (F2 only) in my main SORTOUT dataset, and the PAIRED records (F2 only) in my PAIRED dataset." Paired records mean both F1 & F2. OP is basically looking for RIGHT JOIN. The SORT statements provided below are edited as per OP's requirement. Note that a REFORMAT statement is required unless a JOIN statement with the ONLY operand is specified.
You must use a method in Syncsort (which is called as indicator method in dfsort), to acheive what you're expecting. See below SORT statements.
SORT FIELDS=COPY
JOINKEYS FILE=F1,FIELDS=(25,4,A,115,20,A,135,4,A,140,4,A,5,20,A)
JOINKEYS FILE=F2,FIELDS=(5,4,A,9,20,A,29,4,A,33,4,A,37,20,A)
REFORMAT FIELDS=(F1:p,l,F2:p,l,?)
JOIN UNPAIRED,F2
OUTFIL FNAMES=BOTH,INCLUDE=(53,1,CH,EQ,C'B'),BUILD=(Build the columns you need from F1/F2)
OUTFIL FNAMES=UNPAIRED,INCLUDE=(53,1,CH,EQ,C'2'),BUILD=(Build the columns you need from F2)
where,
p - The position value indicates the first byte of the field relative to the beginning of the input record.
l - The length value indicates the length of the field.
Observe the ? in the REFORMAT FIELDS statement.
Quote from Syncsort for z/OS Programmer's guide:
?
This symbol is used to place a one-byte indicator in the reformatted
record that indicates whether the reformatted record is a paired or an
unpaired joined record. The indicator will be set to one of three
different printable values:
“B” if the reformatted record is a paired
record
“1” if the reformatted record is an unpaired record created
from the F1 file
“2” if the reformatted record is an unpaired record
created from the F2 file
More details:
Paired and unpaired F1/F2 records (indicator method).
Syncsort for z/OS Programmer's guide.
Hope this helps!
Edit 1: OP has mentioned (in the comments section of this answer), "I only want to keep the UNPAIRED records (F2 only) in my main SORTOUT dataset, and the PAIRED records (F2 only) in my PAIRED dataset." Paired records mean both F1 & F2. OP is basically looking for RIGHT JOIN. The SORT statements provided below are edited as per OP's requirement. Note that a REFORMAT statement is required unless a JOIN statement with the ONLY operand is specified.
You must use a method in Syncsort (which is called as indicator method in dfsort), to acheive what you're expecting. See below SORT statements.
SORT FIELDS=COPY
JOINKEYS FILE=F1,FIELDS=(25,4,A,115,20,A,135,4,A,140,4,A,5,20,A)
JOINKEYS FILE=F2,FIELDS=(5,4,A,9,20,A,29,4,A,33,4,A,37,20,A)
REFORMAT FIELDS=(F1:p,l,F2:p,l,?)
JOIN UNPAIRED,F2
OUTFIL FNAMES=BOTH,INCLUDE=(53,1,CH,EQ,C'B'),BUILD=(Build the columns you need from F1/F2)
OUTFIL FNAMES=UNPAIRED,INCLUDE=(53,1,CH,EQ,C'2'),BUILD=(Build the columns you need from F2)
where,
p - The position value indicates the first byte of the field relative to the beginning of the input record.
l - The length value indicates the length of the field.
Observe the ? in the REFORMAT FIELDS statement.
Quote from Syncsort for z/OS Programmer's guide:
?
This symbol is used to place a one-byte indicator in the reformatted
record that indicates whether the reformatted record is a paired or an
unpaired joined record. The indicator will be set to one of three
different printable values:
“B” if the reformatted record is a paired
record
“1” if the reformatted record is an unpaired record created
from the F1 file
“2” if the reformatted record is an unpaired record
created from the F2 file
More details:
Paired and unpaired F1/F2 records (indicator method).
Syncsort for z/OS Programmer's guide.
Hope this helps!
edited Nov 23 '18 at 14:36
answered Nov 23 '18 at 6:41
Srinivasan JvSrinivasan Jv
55548
55548
Thanks. I don't need/want to reformat/include specific records. I only want to keep the UNPAIRED records (F2 only) in my main SORTOUT dataset, and the PAIRED records (F2 only) in my PAIRED dataset.
– user3489502
Nov 23 '18 at 13:31
Ok! Basically you're looking for a RIGHT JOIN.JOIN UNPAIRED,F2,ONLYas you coded in your SORT statement will fetch F2 records that do not have a match in F1 on the specified keys. Consider codingJOIN UNPAIRED,F2which will fetch matching records from F1 and F2 + Non Matching records from F2. AREFORMATstatement is required unless a JOIN statement with the ONLY operand is specified.
– Srinivasan Jv
Nov 23 '18 at 14:03
add a comment |
Thanks. I don't need/want to reformat/include specific records. I only want to keep the UNPAIRED records (F2 only) in my main SORTOUT dataset, and the PAIRED records (F2 only) in my PAIRED dataset.
– user3489502
Nov 23 '18 at 13:31
Ok! Basically you're looking for a RIGHT JOIN.JOIN UNPAIRED,F2,ONLYas you coded in your SORT statement will fetch F2 records that do not have a match in F1 on the specified keys. Consider codingJOIN UNPAIRED,F2which will fetch matching records from F1 and F2 + Non Matching records from F2. AREFORMATstatement is required unless a JOIN statement with the ONLY operand is specified.
– Srinivasan Jv
Nov 23 '18 at 14:03
Thanks. I don't need/want to reformat/include specific records. I only want to keep the UNPAIRED records (F2 only) in my main SORTOUT dataset, and the PAIRED records (F2 only) in my PAIRED dataset.
– user3489502
Nov 23 '18 at 13:31
Thanks. I don't need/want to reformat/include specific records. I only want to keep the UNPAIRED records (F2 only) in my main SORTOUT dataset, and the PAIRED records (F2 only) in my PAIRED dataset.
– user3489502
Nov 23 '18 at 13:31
Ok! Basically you're looking for a RIGHT JOIN.
JOIN UNPAIRED,F2,ONLY as you coded in your SORT statement will fetch F2 records that do not have a match in F1 on the specified keys. Consider coding JOIN UNPAIRED,F2 which will fetch matching records from F1 and F2 + Non Matching records from F2. A REFORMAT statement is required unless a JOIN statement with the ONLY operand is specified.– Srinivasan Jv
Nov 23 '18 at 14:03
Ok! Basically you're looking for a RIGHT JOIN.
JOIN UNPAIRED,F2,ONLY as you coded in your SORT statement will fetch F2 records that do not have a match in F1 on the specified keys. Consider coding JOIN UNPAIRED,F2 which will fetch matching records from F1 and F2 + Non Matching records from F2. A REFORMAT statement is required unless a JOIN statement with the ONLY operand is specified.– Srinivasan Jv
Nov 23 '18 at 14:03
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53436760%2fsyncsort-write-unpaired-records-to-sortout-file-and-paired-records-to-paired%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown