Focal Point
( Closed / Solved ) Capital and non capital in prompt

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

August 27, 2010, 01:37 PM
YKK
( Closed / Solved ) Capital and non capital in prompt
This question is probably very basic but i don't know the answer,

Here is a sample of code
WHERE ( STRC60 EQ '00' ) AND ( CONO60 EQ '01' ) AND ( PNUM60 EQ '&PNUM601' ) OR ( STRC60 EQ '00' )

The answer to &PNUM601 is something like A5555
If the user enter a5555 the procedure return 0 record, how do I make &PNUM601 accept cap and non cap character

Thank you.

Also the car files are not installed on our system so where can I get them

Thank you

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


7.6. / Win 7 / Excel
August 27, 2010, 01:54 PM
N.Selph
You might try at the top of your procedure:

  
-SET &PNUM601_UC =UPCASE(x,'&PNUM601','Ax');

Where x is the length of your input field.

Later on use &PNUM601_UC in your Where clause


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
August 29, 2010, 06:04 PM
Waz
The ensure that the case is always the same, UPCASE the field PNUM60 as well. but this come at a price.

There is a good chance that WebFOCUS will not translate this if the source is an RDBMS, all records will be returned.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

August 30, 2010, 10:47 AM
YKK
Sorry, not working
Inserted that line at the top as suggested
JOIN
LEFT_OUTER INP60.INP60.CONO60 AND INP60.INP60.PNUM60 IN INP60 TO UNIQUE
INP35.INP35.CONO35 AND INP35.INP35.PNUM35 IN INP35 AS J0
END
JOIN
LEFT_OUTER INP35.INP35.PNUM35 AND INP35.INP35.CONO35 IN INP60 TO UNIQUE
YKIN35.YKIN35.PNUX35 AND YKIN35.YKIN35.CONX35 IN YKIN35 AS J1
END
JOIN
LEFT_OUTER INP60.INP60.CONO60 AND INP60.INP60.PNUM60 IN INP60 TO UNIQUE
MSP04.MSP04.CONO04 AND MSP04.MSP04.ITEM04 IN MSP04 AS J2
END
JOIN
LEFT_OUTER INP60.INP60.CONO60 AND INP60.INP60.PNUM60 IN INP60 TO UNIQUE
PMP01.PMP01.CONO01 AND PMP01.PMP01.ITEM01 IN PMP01 AS J3
END
-SET &PNUM601_UC =UPCASE(15,'&PNUM601','A15');
TABLE FILE INP60
PRINT
PDES35 AS 'Description'
PGMN35 AS 'Item ,Group ,Minor'
PUNT35 AS 'Purchase ,Unit'
SUNT35 AS 'Stock ,Unit'
IUNT35 AS 'Issue ,Unit'
SAUP35 AS 'Sales,Analysis,Flag'
STAT35 AS 'Flag,For,Deletion'
CSTM35 AS 'Costing ,Method'
STRM35 AS 'Storage ,Method'
DSSP35 AS 'Prefered,Supplier'
REOP60 AS 'Re-order,Policy'
PRFC60 AS 'Profile,Code'
BNO160 AS 'Landed,Cost,Group'
PITP04 AS 'Item ,Type'
MPSF04 AS 'Planning,Type'
MPFF04 AS 'Demand,Policy'
POPC04 AS 'Order,Policy'
NDYS04 AS 'Number,Of Days,Supply'
FLG104 AS 'MSP/MRP,Filter'
CURP01 AS 'Current,Price'
CURC01 AS 'Currency'
LEAD01 AS 'Lead Time,In,Days'
BY PNUM60
FOOTING
""
WHERE ( STRC60 EQ '00' ) AND ( CONO60 EQ '01' ) AND ( PNUM60 EQ '&PNUM601_UC' ) OR ( STRC60 EQ '00' ) AND ( CONO60 EQ '01' ) AND ( PNUM60 EQ '&PNUM602' );
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,

A5555 is returning 1 line of data
a5555 still return 0 line

Thank you.


7.6. / Win 7 / Excel
August 30, 2010, 11:09 AM
Francis Mariani
YKK,

Is the data in the database table in mixed case, i.e. do A5555 and a5555 both exist in the data, or are you only concerned with what the user is entering as the search criteria? If the data is in uppercase then Waz's suggestion should work.

-SET &ECHO=ALL;

-DEFAULT &PNUM601 = 'a55555';

-SET &PNUM601_UC = UPCASE(&PNUM601.LENGTH, &PNUM601, 'A&PNUM601.LENGTH');

-? &PNUM601

In your example you also have a &PNUM602 variable, in fact, there are a lot of AND and OR statements - are you sure the WHERE is evaluated as you expect it to?

It appears to me that the WHERE statement should be coded as:

WHERE (( STRC60 EQ '00' ) AND ( CONO60 EQ '01' ) AND ( PNUM60 EQ '&PNUM601_UC' )) OR (( STRC60 EQ '00' ) AND ( CONO60 EQ '01' ) AND ( PNUM60 EQ '&PNUM602' ));

or

WHERE STRC60 EQ '00' AND CONO60 EQ '01' AND PNUM60 IN ('&PNUM601_UC', '&PNUM602');



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
September 01, 2010, 10:51 AM
YKK
Thank you

Added the double parenthesis in the where statement and it worked

Again thank you all


7.6. / Win 7 / Excel