Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sort error WER251A

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Sort error WER251A
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Mon Aug 01, 2011 9:30 pm    Post subject: Re: Sort error WER251A
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Aug 01, 2011 9:32 pm    Post subject: Reply to: Sort error WER251A
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

Site Director


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

PostPosted: Mon Aug 01, 2011 9:36 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Aug 01, 2011 9:57 pm    Post subject: Reply to: Sort error WER251A
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Mon Aug 01, 2011 10:01 pm    Post subject: Re: Sort error WER251A
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    Post subject:
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: 2158
Location: @my desk

PostPosted: Tue Aug 02, 2011 1:09 pm    Post subject:
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    Post subject:
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    Post subject:
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: 2158
Location: @my desk

PostPosted: Tue Aug 02, 2011 6:23 pm    Post subject:
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

Site Director


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

PostPosted: Tue Aug 02, 2011 7:57 pm    Post subject: Reply to: Sort error WER251A
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    Post subject:
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    Post subject: Reply to: Sort error WER251A
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

Site Director


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

PostPosted: Fri Aug 05, 2011 2:21 am    Post subject: Reply to: Sort error WER251A
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us