|
View previous topic :: View next topic
|
| Author |
Message |
mushreyas
New User

Joined: 18 Jul 2008 Posts: 59 Location: Bangalore
|
|
|
|
Hi,
I have an input file of length 516 RECFM=FB and i need to sort it so that i can include only non blank records at specific positions. Hence i used the below sort card
| Code: |
SORT FIELDS=COPY
OUTFIL FILES=1, INCLUDE=(1,20,CH,NE,C' ',AND 26,10,CH,NE,C' ',
AND,149,368,CH,NE,C' ')
OUTFIL FILES=2,SAVE
|
My job failed with below error.
| Code: |
SORT FIELDS=COPY
OUTFIL FILES=1, INCLUDE=(1,20,CH,NE,C' ',AND 26,10,CH,NE,C' ',
AND,149,368,CH,NE,C' ')
*
WER251A OMIT/INCLUDE INVALID LENGTH
|
Can anyone help me with this? |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| mushreyas wrote: |
Hi,
I have an input file of length 516 RECFM=FB and i need to sort it so that i can include only non blank records at specific positions. Hence i used the below sort card
| Code: |
SORT FIELDS=COPY
OUTFIL FILES=1, INCLUDE=(1,20,CH,NE,C' ',AND 26,10,CH,NE,C' ',
AND,149,368,CH,NE,C' ')
OUTFIL FILES=2,SAVE
|
My job failed with below error.
| Code: |
SORT FIELDS=COPY
OUTFIL FILES=1, INCLUDE=(1,20,CH,NE,C' ',AND 26,10,CH,NE,C' ',
AND,149,368,CH,NE,C' ')
*
WER251A OMIT/INCLUDE INVALID LENGTH
|
Can anyone help me with this? |
You seem to have some blanks in odd places.
Start position 149 for a length of 368 goes up to 517 bytes, longer than your record. So, fail. |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10902 Location: italy
|
|
|
|
the best anyone will certainly be the manual
not too difficult to look at the message Yourself, and at the info concerning the lengths involved
hint...
most often this kind of error is an oversight in the record length/field descriptions
position+length-1 > record_length, wise to double check Your beliefs |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
| Quote: |
| Can anyone help me with this? |
Suggest you provide more info. . .
What are the recfm and lrecl of the files - this should always be posted? Which release of Syncsort?
I suspect that your main problem is that the max length is 256. . . |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10902 Location: italy
|
|
|
|
agree, that' s what happens for dfsort also
but as usual just a bit of ingenuity , running a simple test would have solved the issue, with no need to post |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| Bill Woodger wrote: |
| Start position 149 for a length of 368 goes up to 517 bytes, longer than your record. So, fail. |
Mmmm.... "Start position". So 148 bytes before, 368 after, matches the Recfm of 516 for your FB.
As Dick is hinting, is the maximum length you can do that compare for less than your 368? Hit the manual.
I don't like the spaces. One is even a "missing" comma?
| Code: |
SORT FIELDS=COPY
OUTFIL FILES=1,INCLUDE=(1,20,CH,NE,C' ',AND,26,10,CH,NE,C' ',
AND,149,368,CH,NE,C' ')
OUTFIL FILES=2,SAVE |
Something in me hopes that your original is not actually working with that part of the code. Much too easy to get something wrong, and for it to "work", if it was like that. |
|
| Back to top |
|
 |
gylbharat
Active Member
.jpg)
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
Hi,
You need to split the comparison
| Code: |
AND,149,368,CH,NE,C' ')
|
in two parts
| Code: |
AND,149,250,CH,NE,C' ',AND,399,118,CH,NE,C' ')
|
Syncsort has a limit of 255 in comparing character fields. |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
| gylbharat wrote: |
| Syncsort has a limit of 255 in comparing character fields. |
gylbharat,
The limit is 256 |
|
| Back to top |
|
 |
kratos86
Active User

Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
| Quote: |
gylbharat wrote:
Syncsort has a limit of 255 in comparing character fields.
gylbharat,
The limit is 256 |
Not always true. The limit depends upon the data format. For CH the limit is 256. |
|
| Back to top |
|
 |
gylbharat
Active Member
.jpg)
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
| I guess characters is CH. Are there any other character formats available? |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
kratos86,
Yes, I should have been specific. But the problem under consideration deals with CH. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Arun,
| Quote: |
| Yes, I should have been specific. |
Nah. . .
The code shows CH, the problem is the length specified for the CH data, and the explanations are for the specifics of the CH.
| Quote: |
| Not always true. The limit depends upon the data format. |
Anyone who sorts anything knows there are different rules for different types of data. How did this add value to the topic?
d |
|
| Back to top |
|
 |
kratos86
Active User

Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
| Quote: |
| Anyone who sorts anything knows there are different rules for different types of data. How did this add value to the topic? |
As far as the WER251A error is concerned, it is applicable for all data types. So hope it will be a good piece of information to know. |
|
| Back to top |
|
 |
mushreyas
New User

Joined: 18 Jul 2008 Posts: 59 Location: Bangalore
|
|
|
|
Thanks you all for your inputs. As some of you stated me to refer the manual which i did and was not able to understand it. Thus posted it here.
Yes the problem was the length which should not exceed 256. Since my requirement was to ignore the records if 367 bytes starting from position 149 is blank. Hence i had to use the below sort card.
| Code: |
SORT FIELDS=COPY
OUTFIL FILES=1,
INCLUDE=(1,20,CH,EQ,C' ',OR,26,10,CH,EQ,C' ', OR,
(149,256,CH,EQ,C' ' AND,405,111,CH,EQ,C' ' ))
OUTFIL FILES=2,SAVE |
SORTOF2 will be my file.[/code] |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thank you for letting us know
d |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|