Focal Point
[SOLVED] Passing the right static value with trailing blanks

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

July 09, 2010, 12:18 PM
Luiz De Assis
[SOLVED] Passing the right static value with trailing blanks
I'm using developer studio to create an amper variable (&BU) that uses a list of static values based on an A12 field (BUSINESS_UNIT). In the Dev Studio variable editor, I select "multiselect OR", "Static List", and "Values for field". After selecting my value, they all show with the "trailing blanks". However, when I run my report and get the prompt page, the static values from my list no longer show the trailing spaces. The report shows zero records when I make a selection and run it. The code created by Dev Studio variable editor is below:

b=blanks
  
WHERE BUSINESS_UNIT EQ &BU.(OR(<bbbbbbbbbbbb3,bbbbbbbbbbbb3>,<bbbbbbbbbbbb6,bbbbbbbbbbbb6>,<bbbbbbbbbb22,bbbbbbbbbb22>)).BUSINESS_UNIT.;


After running the report, the WHERE clause shows '3' instead of 'bbbbbbbbbbb3':

WHERE J0.F0101.BUSINESS_UNIT EQ '3';

I am looking for a resolution using Dev Studio. Thanks

Luiz

WF 7.6.10
  

This message has been edited. Last edited by: Kerry,
July 09, 2010, 01:38 PM
Darin Lee
See if you can use the ASIS function in your request. From the manual:

The ASIS function prevents the source character string from being converted into numeric format when it is used in Dialog Manager and consists of numeric characters and blanks.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
July 09, 2010, 03:12 PM
Luiz De Assis
Darin,

Can you provide me with an example? I've tried "AS IS" in my WHERE clause, but the auto prompt still shows the values without the trailing spaces, and the selected values don't bring up any data. Thanks
July 09, 2010, 04:29 PM
Darin Lee
ASIS (not AS IS) is a function that is recognized by Dialogue Manager in evaluating &variables. There are examples in the documentation.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
July 16, 2010, 09:39 AM
Luiz De Assis
Darin,

I believe the issue is with the auto prompt, which is passing the values for my Business Unit (A12) without the trailing spaces. So if I run it for BU EQ '___________3', the WF auto-prompt shows '3', and that what's been passed to my WHERE BU_FIELD EQ &BU clause. See source below (after running fex). Thanks

TABLE FILE F0301
PRINT
'J0.F0101.ALPHA_NAME'
'J1.F0116.ADDRESS_LINE_1'
'J1.F0116.ADDRESS_LINE_2'
'J1.F0116.CITY'
'J1.F0116.STATE'
'J1.F0116.POSTAL_CODE'
'J0.F0101.CREDIT_MESSAGE' AS 'Credit,Msg'
'F0301.F0301.TEMPORARY_CREDIT_MESSAGE' AS 'Temp,Credit Msg'
'J0.F0101.SEARCH_TYPE'
'J0.F0101.BUSINESS_UNIT'
BY 'F0301.F0301.ADDRESS_NUMBER'
HEADING
"Customer AB by Resp Business Units (Excluding CS Accounts)"
"Report AsOf <+0>Jul 16, 2010 <+0> "
" "
WHERE ( J0.F0101.SEARCH_TYPE EQ 'CS' OR 'C' );
WHERE J0.F0101.BUSINESS_UNIT EQ '3';
July 19, 2010, 11:40 AM
Darin Lee
Did you try ASIS? Your evaluation of what is happening is entirely correct. The problem is that when using Dialogue Manager, if all non-blank characters are numeric, it interprets the value as a number and removes all leading/trailing blanks. The ASIS function forces DM to retain those blanks and treat the variable value as an alpha string.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
July 21, 2010, 02:49 PM
Luiz De Assis
Darin,

I was able to fix it by creating a -SET &BU = ASIS(businesUnitfield); Thank you very much for your suggestion.

Luiz