IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sort error WER251A


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mushreyas

New User


Joined: 18 Jul 2008
Posts: 59
Location: Bangalore

PostPosted: Mon Aug 01, 2011 9:24 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 01, 2011 9:30 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Aug 01, 2011 9:32 pm
Reply with quote

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 icon_cool.gif

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Aug 01, 2011 9:36 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Aug 01, 2011 9:57 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 01, 2011 10:01 pm
Reply with quote

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
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue Aug 02, 2011 11:36 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Aug 02, 2011 1:09 pm
Reply with quote

gylbharat wrote:
Syncsort has a limit of 255 in comparing character fields.
gylbharat,

The limit is 256
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Tue Aug 02, 2011 3:31 pm
Reply with quote

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
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue Aug 02, 2011 3:56 pm
Reply with quote

I guess characters is CH. Are there any other character formats available?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Aug 02, 2011 6:23 pm
Reply with quote

kratos86,

Yes, I should have been specific. But the problem under consideration deals with CH.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Aug 02, 2011 7:57 pm
Reply with quote

Hi Arun,

Quote:
Yes, I should have been specific.
Nah. . . icon_smile.gif

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
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Wed Aug 03, 2011 8:26 am
Reply with quote

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
View user's profile Send private message
mushreyas

New User


Joined: 18 Jul 2008
Posts: 59
Location: Bangalore

PostPosted: Thu Aug 04, 2011 9:06 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Aug 05, 2011 2:21 am
Reply with quote

Good to hear it is working - thank you for letting us know icon_smile.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top