The following DFSORT/ICETOOL JCL will give you the desired results.As per the example all the fields in both files are 6 bytes length.A brief explanation of the job.
The first copy operator takes in the file1 and reformats it using outrec. we copy the first 36 bytes as is and after that we add 18 binary zeroes for the fields of file2.After that we pad the rest of the bytes with spaces( assuming that your input files is 80 bytes in length).We also add a sequence number at the end.
The second copy operator takes in the file2 and reformats it using outrec.The first 36 bytes will be padded with binary zeroes and after that we copy 3 fields ( f,g,h) and also make it 80 bytes. we also add the sequence number at the end.
Now the final sort takes in these 2 temp files and sort it on the seqnum and summing the fields from 36 to 54 bytes there by achieving the desired results.We also strip off the seqnum while writting the out.
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
Posted: Tue Dec 17, 2002 7:41 am Post subject:
Kolusu,
I think there is a flaw in the CTL1CNTL and CTL2CNTL DD statements.
Quote:
After that we pad the rest of the bytes with spaces( assuming that your input files is 80 bytes in length).
You have put 80:X which means put a space at the 80th column. Your intention was to pad spaces till 80 bytes.
The code would still run fine. But, I just thought of pointing out the mismatch in what you wanted and what will happen. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Tue Dec 17, 2002 8:26 am Post subject:
Cogito,
The solution is not flawed.80:X tells DFSORT to pad with blanks up to position 80.your assumption is wrong that it will only put a space in the 80th column.
Kolusu
Last edited by kolusu on Tue Dec 17, 2002 8:57 am; edited 1 time in total
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
Posted: Tue Dec 17, 2002 8:42 am Post subject:
Today I learnt a new thing.
Suppose, instead of 80:X, if you had coded 50:X, the columns till 50 would be spaces. After that? They appear as dots in my file. When you say col_num:X, col_num stands for col_num of O/P file. This rule and the above observation (dots) made me assume that every byte of O/P file must be "told" what it must carry. So, I did not even test before posting!
I apologise. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Tue Dec 17, 2002 8:47 am Post subject:
Cogito,
If your file is 80 bytes length and you code 50:x , then it will pad with spaces up to the 50th position and from the 51st position you will have binary zeroes(as seen like dots) upto position 80.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Dec 17, 2002 11:41 am Post subject:
Cogito,
80:X means to pad with blanks from the next position to position 80. 50:X means to pad with blanks from the next position to position 50.
If you had:
Code:
OUTREC FIELDS=(1,20,50:X)
DFSORT would pad with blanks from position 21 to position 50. If you do not specify the LRECL for the output data set, then DFSORT would automatically set the LRECL/record length from the OUTREC length (50). If you do specify the LRECL (or the data set is old and already has an LRECL), then DFSORT keeps the specified record length and pads with zeroes after the last OUTREC position to the LRECL.
For example, the OUTREC statement above will give you 50-byte records with blanks from 21-50 if the SORTOUT statement is:
whereas, the OUTREC statement above will give you 80-byte records with blanks from 21-50 and binary zeros from 51-80 if the SORTOUT statement is either:
Note that for OUTFIL (unlike INREC or OUTREC), you will get an error message and terminate if the OUTREC=(...) length does not match the LRECL of the output data set. That is:
would result in termination with this error message:
Code:
ICE222A 0 50 BYTE FIXED RECORD LENGTH IS NOT EQUAL TO 80 BYTE LRECL FOR SORTOUT
So if you want padding with binary zeros to the LRECL, use INREC or OUTREC. If you want termination, use OUTFIL. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Last edited by Frank Yaeger on Wed Mar 19, 2003 4:40 pm; edited 1 time in total
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Dec 18, 2002 11:54 am Post subject:
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Kolusu,
Is Synctool an alias for Syncsort ? or is it a addon to Syncsort. When I try to use Synctool I get an RC=20. This error is not from sort, what could it be, does it mean my installation does not have synctool ? Thanks
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Fri Feb 28, 2003 11:26 am Post subject:
SureshKumar,
As far as I know synctool is just another add on tool from syncsort. Your installation do have synctool. The return code of 20 means that there is something wrong with your toolin statements. post your jcl and the error messages and I will try to fix them.
A dumb question to ask. Are you using the same JCL posted by me replacing the pgm name to synctool or are you using an existing regular sort job with pgm name synctool??
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Fri Feb 28, 2003 11:54 am Post subject:
SureshKumar,
Let us put the sarcasm aside and concentrate on solving the problem. You still did not post the error messages. please post the error messages from TOOLMSG & DFSMSG.
All times are GMT - 5 Hours Goto page 1, 2, 3, 4Next
Page 1 of 4
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum