Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Quote:
So then I change the imput files to 106 FB and get this message..
Why would you change the input files to 106?
You need to leave your input files as they are, and ensure that you output files either don't specify DCB info (better) or have DCB info reflecting the length of the output records.
So then I change the imput files to 106 FB and get this message..
Why would you change the input files to 106?
You need to leave your input files as they are, and ensure that you output files either don't specify DCB info (better) or have DCB info reflecting the length of the output records.
I changed it to 106 just because im not sure why its not working.. so im trying anthying I can think of..
How to I take my original code, and reformat teh colums I want?
I can only get the match/unmatch dataset to populate data if I have my reformat do all the colums.
Code:
REFORMAT FIELDS=(F1:1,600,F2:1,600)
But I don't want to have all the columns.. I want this:
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Re-read my previous post.
Your error is occurring, I expect, because your output files are defined, either in the JCL or in the catalog, as 600 bytes, FB. When you try to write 106 bytes FB from SORT, SORT is clever enough to notice, so fails.
Your input files need to be 600. Your output files need to be 106.
Your output files will be 106 if you remove LRECL information from the JCL (if that is where you are specifying it) or if you are using pre-allocated output files, change the LRECL for the allocation to 106 (and remember to do that every time you have to change the REFORMAT statement).
Your REFORMAT statement is working. It is just the way you have the JCL and/or catalog that is getting in the way.
Your error is occurring, I expect, because your output files are defined, either in the JCL or in the catalog, as 600 bytes, FB. When you try to write 106 bytes FB from SORT, SORT is clever enough to notice, so fails.
Your input files need to be 600. Your output files need to be 106.
Your output files will be 106 if you remove LRECL information from the JCL (if that is where you are specifying it) or if you are using pre-allocated output files, change the LRECL for the allocation to 106 (and remember to do that every time you have to change the REFORMAT statement).
Your REFORMAT statement is working. It is just the way you have the JCL and/or catalog that is getting in the way.
I changed my code to what you have specified. Here is the code I am now running.
Well, here, you still want to output your 600-byte records.
You either need to change this to write out your 106-byte records (with 102 bytes of blanks for your unmatched records) or change them to 106 and 4 bytes...
Or go back to explain exactly what it is you want to do.
Well, here, you still want to output your 600-byte records.
You either need to change this to write out your 106-byte records (with 102 bytes of blanks for your unmatched records) or change them to 106 and 4 bytes...
Or go back to explain exactly what it is you want to do.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Well, since there is no match, you only have data on F1. You can BUILD for 106, if you want the 102 bytes of blanks.
Or, if in the case of no match you want the equivalent F1 fields, you have to include those in the REFORMAT for the F1 part, and then include those in the BUILD.
BUILD=(1,106) for the unmatched, BULD=(1,4,107,102) for the matched (assuming you have included all your F1 fields in the REFORMAT so it is now 208 bytes long).
Well, since there is no match, you only have data on F1. You can BUILD for 106, if you want the 102 bytes of blanks.
Or, if in the case of no match you want the equivalent F1 fields, you have to include those in the REFORMAT for the F1 part, and then include those in the BUILD.
BUILD=(1,106) for the unmatched, BULD=(1,4,107,102) for the matched (assuming you have included all your F1 fields in the REFORMAT so it is now 208 bytes long).
I guess im not following..
Right now i have the UNMATCHED file which just contains 2 records and just shows the first 4 bytes...
I want the format of the UMATCHED file to be be the same format of the MATCHED files, what would be the specific code to accomplish this?
I want the MATCHED and UNMATCHED dataset to contain this format.. right now.. only the matched file contains this format.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
In the REFORMAT statement, all the F1 fields come your your first JOINKEYS file.
You specify JOIN UNPAIRED,F1. That will get you matched records, and unmatched records from F1 only (unmatched records from F2 will be ignored).
For you matched records, this, REFORMAT FIELDS=(F1:1,3,64,1,F2:1,3,7,30,37,30,67,30,125,9), gives you what you want.
However, what do you want when there is a record on F1 which does not match F2? All the fields following F2 on the REFORMAT statement will contain blanks in such a case.
You either want those blanks in your output, in which case also do BUILD=(1,106) for your unmatched records, or you want the data in the same positions from F1. There is no other choice. There is no F2 data that can go there, because you didn't match.
In the REFORMAT statement, all the F1 fields come your your first JOINKEYS file.
You specify JOIN UNPAIRED,F1. That will get you matched records, and unmatched records from F1 only (unmatched records from F2 will be ignored).
For you matched records, this, REFORMAT FIELDS=(F1:1,3,64,1,F2:1,3,7,30,37,30,67,30,125,9), gives you what you want.
However, what do you want when there is a record on F1 which does not match F2? All the fields following F2 on the REFORMAT statement will contain blanks in such a case.
You either want those blanks in your output, in which case also do BUILD=(1,106) for your unmatched records, or you want the data in the same positions from F1. There is no other choice. There is no F2 data that can go there, because you didn't match.
Is there a way to have the UNMATCHED Records show all the records in the F1 file? so ;ike 1.106 ? instead of just the first 3 bytes and the 1 byte in position 64?
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
The 5,1 is left over from earlier.
It now needs to be 107,1.
SyncSort does not have a "marker" to indicate a match. By default an the "other" record from a mismatch is set to blanks, so you get blanks in the REFORMAT record. This can be modified using FILL= on the REFORMAT.
If the first byte of your F2 on the REFORMAT record can never be blank, then you can test for blanks to know there is no F2 record. Else you find some other byte which can never be blank, or some byte which can never have a particular value and use FILL=.