Focal Point
[SOLVED] Right Justified Indexed Fields

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

January 11, 2010, 05:27 PM
Joe Beydoun
[SOLVED] Right Justified Indexed Fields
Hello All,

We are a fresh new customer of IBI and we have an issue i am not able to figure out yet.

We have indexed character fields that are right justified in our DB2 tables, we'd like to parm those fields in a report but avoid the user adding the spaces. The LJust command causes the program to halt since i lose my indexing, and lookup tables take too long to load.
We're looking for functionality to do this before sending into the where clause.

Hope i explained clear enought. We're on WF 7.6.10 on an Iseries server.

This message has been edited. Last edited by: Joe Beydoun,


version 8202M
Reporting Server on
Windows Server using DB2 Connect to access data from iseries.
January 11, 2010, 05:52 PM
Dan Satchell
Have you tried right-justifying your user input parm using the RJUST function?

DEFINE FILE <filename>
 USER_INPUT/A<input length> = RJUST(<input length>, <input parm>, USER_INPUT)
END

TABLE FILE <filename>
 SUM/PRINT <column name(s)>
 BY <column name>
 .
 .
 WHERE <indexed column name> EQ USER_INPUT ;
END



WebFOCUS 7.7.05
January 11, 2010, 06:25 PM
Joe Beydoun
Dan,

Doing a define does the computation on every field in the file before reaching the where clause, on a 27m record file, it completely slows the report down.

Thanks.


version 8202M
Reporting Server on
Windows Server using DB2 Connect to access data from iseries.
January 12, 2010, 12:42 AM
Danny-SRL
Joe,

Right-Justified? Is this Hebrew or Arabic?

Are you saying that the user enters a parameter value (in &PARM) and then you want to RJUST it? Could you use:
  
-SET &PARMLEN=&PARM.LENGTH;
-SET &MYPARM=RJUST(&PARMLEN, &PARM, 'A&PARMLEN.EVAL');
...
TABLE FILE filename
...
WHERE field EQ '&MYPARM'
...
END



Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

January 12, 2010, 04:35 AM
Dan Satchell
Joe,

You are absolutely correct about using DEFINE to right-justify the user input. The Dialogue Manager solution from Daniel is the way to go.


WebFOCUS 7.7.05
January 20, 2010, 10:49 AM
Joe Beydoun
Dan and Danny, thanks for the responses, but the issue was resolved using this code since the Parm Lenght function only returned the lenght of characters i typed:

-SET &ITEM = RJUST 10,&ITEM ' ','A10');

I'll take different suggestions if they're available, but i'll call this issue resolved.


version 8202M
Reporting Server on
Windows Server using DB2 Connect to access data from iseries.