Focal Point
[WORKAROUND] WHERE statement truncated at 80 characters

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5261053103

October 02, 2008, 02:56 PM
JDroke
[WORKAROUND] WHERE statement truncated at 80 characters
I wrote an initial WebFocus report in 7.6.6 and it ran fine with the Where statement...

WHERE ( COMPANY EQ '&COMPANY.(FIND COMPANY,COMPANY IN IRSUM).Company.' ) AND ( WAREHOUSE EQ '&WAREHOUSE.(FIND WAREHOUSE IN IRSUM).Warehouse.' );

...but after I save and close it and then reopen it, it won't run (I get an error) and the Where statement has been truncated to 80 characters...

WHERE ( COMPANY EQ '&COMPANY.(FIND COMPANY,COMPANY IN IRSUM).Company.' ) AND ( W

I tried searching on "where statement trucated" but found nothing. Anyone know what I'm doing wrong?

This message has been edited. Last edited by: JDroke,


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
October 02, 2008, 03:20 PM
RSquared
What error do you get ?


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
October 02, 2008, 04:15 PM
FrankDutch
Split the code into two lines

WHERE ( COMPANY EQ '&COMPANY.(FIND COMPANY IN IRSUM).Company.' ) ;
WHERE ( WAREHOUSE EQ '&WAREHOUSE.(FIND WAREHOUSE IN IRSUM).Warehouse.' );


and see what happens.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

October 02, 2008, 04:41 PM
JDroke
RSquared,
Thanks for your reply. The error was unimportant and not realted since it was a result of the truncatin of the Where statment which made the next statement invalid (ON TABLE SET...).

FrankDutch,
Thanks for your reply. That worked (separate Where statements). However, I abbreviated my initial Where statement example for this post. The actual original Where statement is...

WHERE ( COMPANY EQ '&COMPANY.(FIND COMPANY,COMPANY IN IRSUM).Company.' ) AND ( WAREHOUSE EQ '&WAREHOUSE.(FIND WAREHOUSE IN IRSUM).Warehouse.' ) AND ( LOGO EQ '&LOGO.(FIND LOGO IN IRUPC).Logo.' ) AND ( DATE GE '&FROMDATE.From Date.' ) AND ( DATE LE '&THRUDATE.Thru Date.' ) AND (( BOSBEGPRS NE 0 ) OR ( BOSRCPPRS NE 0 ) OR ( BOSHPPRS NE 0 ) OR ( BOSADJPRS NE 0 ) OR ( BOSRTNPRS NE 0 ) OR ( BOSENDPRS NE 0 ));

...so now my dilemma is how to get that last "AND" statement in there since there is no way it will fit in 80 characters and if I split it on two lines it won't work logically (since I would assume the multiple Where statements are "ANDed" together).


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
October 02, 2008, 05:01 PM
FrankDutch
This should fit on one line I think.

WHERE (( BOSBEGPRS NE 0 ) OR ( BOSRCPPRS NE 0 ) OR ( BOSHPPRS NE 0 ) OR ( BOSADJPRS NE 0 ) OR ( BOSRTNPRS NE 0 ) OR ( BOSENDPRS NE 0 ));


Else you can make a DEFINE field that meets this restrictions and use that as a single WHERE.

DEFINE FILE XXX
SPECIAL/A1= IF (( BOSBEGPRS NE 0 ) OR 
( BOSRCPPRS NE 0 ) OR 
( BOSHPPRS NE 0 ) OR 
( BOSADJPRS NE 0 ) OR 
( BOSRTNPRS NE 0 ) OR 
( BOSENDPRS NE 0 )) THEN 'N' ELSE 'Y';
END

....

WHERE SPECIAL EQ 'N';
....





Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

October 02, 2008, 05:40 PM
Francis Mariani
quote:
WHERE ( COMPANY EQ '&COMPANY.(FIND COMPANY,COMPANY IN IRSUM).Company.' ) AND ( WAREHOUSE EQ '&WAREHOUSE.(FIND WAREHOUSE IN IRSUM).Warehouse.' ) AND ( LOGO EQ '&LOGO.(FIND LOGO IN IRUPC).Logo.' ) AND ( DATE GE '&FROMDATE.From Date.' ) AND ( DATE LE '&THRUDATE.Thru Date.' ) AND (( BOSBEGPRS NE 0 ) OR ( BOSRCPPRS NE 0 ) OR ( BOSHPPRS NE 0 ) OR ( BOSADJPRS NE 0 ) OR ( BOSRTNPRS NE 0 ) OR ( BOSENDPRS NE 0 ));

I assume you're using Dev Studio Report Painter to create your WHERE statement. I suggest splitting each of the statements in the WHERE to individual WHERE statements:

WHERE COMPANY EQ '&COMPANY.(FIND COMPANY,COMPANY IN IRSUM).Company.';
WHERE WAREHOUSE EQ '&WAREHOUSE.(FIND WAREHOUSE IN IRSUM).Warehouse.';
WHERE LOGO EQ '&LOGO.(FIND LOGO IN IRUPC).Logo.';
WHERE DATE GE '&FROMDATE.From Date.' AND DATE LE '&THRUDATE.Thru Date.';
WHERE BOSBEGPRS NE 0 OR BOSRCPPRS NE 0 OR BOSHPPRS NE 0 OR BOSADJPRS NE 0 OR BOSRTNPRS NE 0 OR BOSENDPRS NE 0;

Each of the WHERE statements will be available in the Where section of the Report Options dialog box, including the last one - it does not get truncated in my 7.6.5 Dev Studio Report Painter.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
October 02, 2008, 06:59 PM
JDroke
quote:
Each of the WHERE statements will be available in the Where section of the Report Options dialog box, including the last one - it does not get truncated in my 7.6.5 Dev Studio Report Painter.

I am using Report Painter in Dev Studio (7.6.6) and it is truncating exactly at 80 characters so that last line is too long. Is this truncation normal behavior of the software?


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
October 02, 2008, 09:25 PM
Piipster
The 80 character limit is an historical thing. It should not be truncating at 80 characters.

I tried to reproduce this behaviour in R766 and couldn't. If you open a case, upload the original fex and master file I will take a look at it, just let me know what the case number is.


ttfn, kp


Access to most releases from R52x, on multiple platforms.
October 02, 2008, 11:14 PM
TexasStingray
I would really look at breaking it up because if you use the resource layout and in 1 of the parameters you select all the whole where statement will be ignored. FOC_NONE throws away the whole statment that makes up any single command.




Scott

quote:
AND (( BOSBEGPRS NE 0 ) OR ( BOSRCPPRS NE 0 ) OR ( BOSHPPRS NE 0 ) OR ( BOSADJPRS NE 0 ) OR ( BOSRTNPRS NE 0 ) OR ( BOSENDPRS NE 0 ));
and get rid of extraneous white space!

You could also write the above as -

AND (BOSBEGPRS NE 0 OR BOSRCPPRS NE 0 OR BOSHPPRS NE 0 OR BOSADJPRS NE 0 OR BOSRTNPRS NE 0 OR BOSENDPRS NE 0);

I would recommend you to take up Karen's generous offer. Raise a case and let her know the number!!

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
Tony A - that where statement (with the white space and parenthesis) came from the Report Painter.

I opened a case on it and sent the case number to Piipster.

Thanks everyone for the replies.

This message has been edited. Last edited by: JDroke,


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
Can any of the numbers be negative? If not, change your where to:
WHERE BOSBEGPRS + BOSRCPPRS + BOSHPPRS + BOSADJPRS + BOSRTNPRS + BOSENDPRS NE 0;


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
Yes the numbers can be negative but the real issue is that these are inventory numbers (receipts, shipments, adjustments and returns) so each has to be tested individually since we want to show the record if there are items there or there was inventory movement.


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
I've faced this situation before. And it sounds more like the fact that you're on a mainframe and your procedures (focexecs) are being stored in a PDS with a fixed LRECL of 80. Check it out. If so, just limit your code to LE 80 characters.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
Without knowing the entire 'logic tree' it seems that you might break up the WHERE statements into logical groups ?

I believe that WF causes ANDed conditions to become FALSE when the first FALSE condition is encountered, so prioritize them with the most-likely-to-be-false first in the list ?

FrankDutch's suggestion to use DEFINEs might also help make all those conditons more manageable in the process of making each condition shorter.


WF 7.6.4 & 5.3
Charles Lee
Doug - good call because I found out earlier this morning that it was any statement since I just added a drill down to an fex needing seven parameters and it chopped it off too. It's not limited to only WHERE statements.

Is there any way to check that PDS and record length?


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
Well before anyone could figure it out at tech support, I created a new application (folder) and moved all of my focexecs, master and access files over to the new folder and they are working correctly now. the original folder was built at install time and was 7.6.4 or earlier and evidently had the problem. Since we are a new customer and this is the first report, this new application (folder) solves our problem.

Thanks to all that replied!


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
Start by asking your systems people for that information. I have found that the datasets on the mainframe for focexecs and MFDs are, predominantly, Fixed 80, while the datasets for HTML is variable length.

I really wouldn't call this a 'workaround' as it is 'working as designed'.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
As of 5.2 focexec line lengths over 80 characters are supported

quote:
The following are the recommended DCB attributes for a wide FOCEXEC PDS:

Record Format (RECFM) VB.

Logical Record Length (LRECL) up to 4096.

System defined DASD default block size

quote:
Originally posted by Doug:
Start by asking your systems people for that information. I have found that the datasets on the mainframe for focexecs and MFDs are, predominantly, Fixed 80, while the datasets for HTML is variable length.

I really wouldn't call this a 'workaround' as it is 'working as designed'.

Well I didn't want to call it "solved" so I picked "workaround". Since I was able to create a new application and copy my FOCEXECS there and they were no longer being truncated - I'd say that was a work around and that there is still some kind of problem with the original application that was created and/or brought in here during the installation by the IBI installer.

This message has been edited. Last edited by: JDroke,


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
quote:
that was created in 7.6.4 by the IBI installer

Do not disagree with that.

There is no reason why the focexec PDS should have been created as anything other
that shown above, unless it is a site requirement.

That is so obsolete, it verges on being prehistoric in computing terms.
I guess I'm not at all familiar with the term "focexec PDS". Where is it and how can I check it. As mentioned previously, I did not make any changes other than to simply create a new application and copy my focexecs and master/acx files over and that one works.


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
quote:
Windows Server 2003

I think we (I) may have been guilty of misguiding you here.

Your WebFocus Server is on Windows 2003?

If that is the case PDS is totally of no interest as it relates only to mainframe.

Windows does not have a fixed length file issue and it sounds like you have just been unlucky.