1st field is 14 digits, number(14)
2nd field 100 characters(100)
3rd fled sign leading value(17)
This is working fine for 3rd fled sign leading value(17).
In this case its not working... output is:
20100901021430TESTING TESTING 123+1234567890123456
20100901031531TESTING TESTING 234+123456789012345
20100901031531TESTING TESTING 234+123456745345345
20100901041531TESTING TESTING 345+1297977890123456
It provided the output as all the postitve values for 3rd field....
Is the 17 length(including sign) is the limit in SORT or am i missing anything here.... Please suggest....
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
I'm going to take an educated guess that your input is different than it appears in your example. You aren't using BBCode tags so it's difficult to see what your input really looks like, but I'm guessing that there are blanks between the | and third number, e.g. |bb12345678901234567. That would explain the output you get because FIXLEN=18 would NOT give you all of the digits if there are blanks before them.
Try using:
Code:
%02=(FIXLEN=25)),
That should give you all of the digits instead of truncating them. See if that gives you the output you want.
There are no spaces in the 3rd field
"12345678901234567" (17 digits),
"-12345678901234567" (sign + 17 digits)
Frank, i can't use the length 25 because output of this SORT step will be given to next step which is a productionised. Hence i consdered the length as 18 (sign + 17 digits)...Please suggest...
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Using FIXLEN=25 has no effect on the length of the output field ... that's controlled by the EDIT mask which has sign + 17 digits.
Did you even try using FIXLEN=25?
If there are no spaces in the 3rd field, then I don't know how you're getting the results you're getting. That's certainly not what I get with DFSORT.
Quote:
Please suggest...
I can't because I don't know what it is you're NOT telling me about your data or job.
Please post your input and output records using code tags so I can see what it really looks like. Post the complete JES messages from your run.
If you like, you can send me the information offline (yaeger@us.ibm.com) as plain text (.txt) files. Until I know what you're doing that doesn't correspond to what I see in your posts, I can't help you.
However, the WER messages indicate you're using Syncsort, not DFSORT. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort. If Syncsort is producing the wrong results, I certainly can't help you with that.
In the future, please post in the Syncsort Forum, not the DFSORT Forum.
The BUILD then places these values in the INREC record starting at position 35 (still left-justified in 25 bytes):
35,18,SFF,EDIT=(STTTTTTTTTTTTTTTTT),SIGNS=('+','-')) in OUTREC
uses SFF to extract the digits starting from position 35 for 18 bytes. Since the digits are left-justified, that would include all of the digits. They should then be edited to:
Thanks Frank, Dick and Alissa for your suggestions ........
Am sorry that i was posted this question in DFSORT.......
My input file is a pipe (|) delimited file and i know the maximum length of the each field. Every record doesn't have the maximum value.
1st field length =14
2nd field length=20
3rd field length=18 (sign + 17digits)
Since i dont know the exact length of the field of the record i cannot use OUTREC in this scenario. Hence i used INREC PARSE to split the file based on the pipe symbol.
20100901021430TEST +12345678901234567 TEST1A
20100901031531TESTING -12345678901234567 TEST B
20100901031531TESTING123 -12345674534534577 TEST2C
20100901041531TESTING TESTING 345 +12979778901234567 TEST D
20100901031531TESTING123 -3456 TEST3E
20100901041531TESTING TESTING 345 +179 TEST F
20100901031531TESTING -123456 TEST4G
Alissa....
Without IFTHEN for second time it will work. Please see the below code...
In my actual scenario there are 37 fields so i need to check the position and length for each field. Hence i used directly BUILD section as below.
20100901021430TEST +12345678901234567TEST1A
20100901031531TESTING -12345678901234567TEST B
20100901031531TESTING123 -12345674534534577TEST2C
20100901041531TESTING TESTING 345 +12979778901234567TEST D
20100901031531TESTING123 -3456TEST3E
20100901041531TESTING TESTING 345 +179TEST F
20100901031531TESTING -123456TEST4G
But when i try use JFY=(SHIFT=LEFT) in the BUILD section(specified below) its throwing syntax error. I have tried SQZ and JFY. For both options its throwing syntax error.
But when i try use JFY=(SHIFT=LEFT) in the BUILD section(specified below) its throwing syntax error. I have tried SQZ and JFY. For both options its throwing syntax error... Here i want to do left alignment for 3rd field. Please suggest.
So put back the second IFTHEN statement. What is the problem here?
In my actual scenario there are 37 fields for 25 different files so i need to check the position and length for each field. Hence i thought that if i directly use BULID no need to calculate the next position of the field so it will reduce some effort as i have to code the same for 25 files (37 to 41 fields each).
If any option is there in BUILD to align the numbers (LEFT) please suggest how to proceed......