Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     SOLVED: READ command is adding the length to the start of my variables

Read-Only Read-Only Topic
Go
Search
Notify
Tools
SOLVED: READ command is adding the length to the start of my variables
 Login/Join
 
Member
posted
I'm trying to display a user-friendly representation of the report criteria in the header of a report that I'm working on. This is an HTML report, and I pass in region, district and territory IDs from the submission form, but I want to display the selected region/district/territory names rather than their IDs. I have a hold file that I -include for the form, that already does the lookups, so I -include that in the report as well, and reference it like so:

TABLE FILE TERR_DATA_HOLD
BY REGION_NAME
BY DISTRICT_NAME
BY TERRITORY_CLIENT_ID
WHERE REGION_ID EQ '&Region';
WHERE DISTRICT_ID EQ '&District';
WHERE TERRITORY_ID EQ '&Territory';
ON TABLE HOLD FORMAT ALPHA AS CRITERIA_NAMES
END
-RUN
-READ CRITERIA_NAMES &RegionCriteriaName.A30. &DistrictCriteriaName.A30. &TerritoryCriteriaName.A20.
-RUN

-SET &RegionCriteriaText = IF &Region EQ _FOC_NULL THEN 'All Regions' ELSE 'Region: ' | &RegionCriteriaName;
-SET &DistrictCriteriaText = IF &District EQ _FOC_NULL THEN 'All Districts' ELSE 'District: ' | &DistrictCriteriaName;
-SET &TerritoryCriteriaText = IF &Territory EQ _FOC_NULL THEN 'All Territories' ELSE 'Territory: ' | &TerritoryCriteriaName;


But when I display &RegionCriteriaName in the report header, it shows up as something like "000007Central". The length of the region name is placed at the start of the variable. I suppose I could just trim off the first 6 characters (since it appears to be consistently using 6 characters for the length), but I would rather understand why it is adding that, and if there is a better way to get the data into a variable.

I'm very new to WebFOCUS and I've learned most of what I know from the forums. Thanks for any help you can provide.

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


WebFOCUS 7.7
Windows, All Outputs
 
Posts: 2 | Registered: April 15, 2011Report This Post
Master
posted Hide Post
it is happening because your source is a variable length field and those first 6 or so numerics are the length of the text that it contains. basically, edit() it out.

-ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
 
Posts: 561 | Registered: February 03, 2010Report This Post
Master
posted Hide Post
or redefine the source field in the Define to a fixed length field.

- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
 
Posts: 561 | Registered: February 03, 2010Report This Post
Expert
posted Hide Post
Or just use the format on the request with a save.
TABLE FILE TERR_DATA_HOLD
SUM REGION_NAME/A30
    DISTRICT_NAME/A30
    TERRITORY_CLIENT_ID/A20
BY REGION_NAME NOPRINT
BY DISTRICT_NAME NOPRINT
BY TERRITORY_CLIENT_ID NOPRINT
WHERE REGION_ID EQ '&Region';
WHERE DISTRICT_ID EQ '&District';
WHERE TERRITORY_ID EQ '&Territory';
ON TABLE SAVE FORMAT
END
-RUN
-READ CRITERIA_NAMES &RegionCriteriaName.A30. &DistrictCriteriaName.A30. &TerritoryCriteriaName.A20.
-RUN


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
Thanks all. ABT's solution took care of the issue. However, I think Waz's idea will result in more succinct code in this particular case, so I'll probably update the code to do that instead.


WebFOCUS 7.7
Windows, All Outputs
 
Posts: 2 | Registered: April 15, 2011Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     SOLVED: READ command is adding the length to the start of my variables

Copyright © 1996-2020 Information Builders