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     [CLOSED] READ feature Loading record fields into amper variables

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] READ feature Loading record fields into amper variables
 Login/Join
 
Member
posted
CAR LENGTH WIDTH HEIGHT
JAGUAR 190 66 48
JAGUAR 199 70 54

Trying to load 3 amper variables LENGTH WIDTH HEIGHT with decimal data. Length, Width and Height are all D5. I should get
389 136 and 102 but as you can see I don't. What am I doing run?

-* File newfex.fex
TABLE FILE CAR
SUM
LENGTH
WIDTH
HEIGHT
WHERE CAR EQ 'JAGUAR';
ON TABLE HOLD
END

? HOLD
-RUN
-READ HOLD, &vLENGTH
-TYPE &vLENGTH
-EXIT
END

gives me
0 NUMBER OF RECORDS IN TABLE= 2 LINES= 1
0DEFINITION OF HOLD FILE: HOLD
0FIELDNAME ALIAS FORMAT
LENGTH E01 D5
WIDTH E02 D5
HEIGHT E03 D5
fffffFx@fffff÷`@fffffåY@



IF I change
-READ HOLD, &vLENGTH
to
-READ HOLD, &vLENGTH.D5.
I get
0 NUMBER OF RECORDS IN TABLE= 2 LINES= 1
0DEFINITION OF HOLD FILE: HOLD
0FIELDNAME ALIAS FORMAT
LENGTH E01 D5
WIDTH E02 D5
HEIGHT E03 D5
0 ERROR AT OR NEAR LINE 13 IN PROCEDURE newfex.fex
(FOC299) UNRECOGNIZED FORMAT OF AMPER VARIABLE IN -READ: -READ HOLD,
&vLENGTH.D5.


IF I change
-READ HOLD, &vLENGTH
to
-READ HOLD, &vLENGTH.I5
I get
0 NUMBER OF RECORDS IN TABLE= 2 LINES= 1
0DEFINITION OF HOLD FILE: HOLD
0FIELDNAME ALIAS FORMAT
LENGTH E01 D5
WIDTH E02 D5
HEIGHT E03 D5
fffff

Same for I6, A5, A6

NEXT SCENARIO: Print all 3 Amper varaibles
TABLE FILE CAR
SUM
LENGTH
WIDTH
HEIGHT
WHERE CAR EQ 'JAGUAR';
ON TABLE HOLD
END

? HOLD
-RUN
-READ HOLD, &vLENGTH.D5., &vWIDTH.I5., &vHEIGHT.I5.,
-TYPE &vLENGTH &vWIDTH &vHEIGHT
-EXIT
END

I get (nothing)

0 NUMBER OF RECORDS IN TABLE= 2 LINES= 1
0DEFINITION OF HOLD FILE: HOLD
0FIELDNAME ALIAS FORMAT
LENGTH E01 D5
WIDTH E02 D5
HEIGHT E03 D5

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


Webfocus 7.6.6
Solaris 10 Sparc 64bit
 
Posts: 20 | Registered: January 21, 2009Report This Post
Expert
posted Hide Post
Try ON TABLE HOLD FORMAT ALPHA. The WebFOCUS default for a hold file is binary.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Member
posted Hide Post
Same problem.


Webfocus 7.6.6
Solaris 10 Sparc 64bit
 
Posts: 20 | Registered: January 21, 2009Report This Post
Expert
posted Hide Post
Not a problem if you follow Ginny's advice:

  
TABLE FILE CAR
SUM
LENGTH
WIDTH
HEIGHT
WHERE CAR EQ 'JAGUAR';
ON TABLE HOLD FORMAT ALPHA
END
-RUN
?FF HOLD
-READ HOLD &LENGTH.I5. &WIDTH.I5. &HEIGHT.I5.
-TYPE LENGTH: &LENGTH
-TYPE WIDTH:  &WIDTH
-TYPE HEIGHT: &HEIGHT
-EXIT


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Silver Member
posted Hide Post
Note that one important change made by Tom is also the removal of the commas (,) from the -READ statement.


WF 7.6.4
Windows XP and UNIX
 
Posts: 41 | Registered: November 26, 2008Report This Post
Master
posted Hide Post
use SAVE FORMAT ALPHA

Hold the file in a location you can read later then you can look at it and determine how many characters to read for each variable.




Scott

 
Posts: 865 | Registered: May 24, 2004Report This Post
Expert
posted Hide Post
As Texas suggests, use SAVE instead of HOLD unless you are going to perform a TABLE request against that file.

SAVE doesn't produce a master file whereas HOLD does as was pointed out by Tom here.

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
IronMaiden,

The first thing you have to understand is that Dialog Manager deals exclusively with CHARACTERS. &variables contain CHARACTERS which might be only numbers. That is why Ginny, Texas and Tony suggested that you use either HOLD FORMAT ALPHA or SAVE.

Also, when you use HOLD FORMAT ALPHA or SAVE, WebFocus creates records which end with CRLF, something that -READ needs.

When you want to -READ data from a file, there are 2 formats: fixed or comma-delimited. When you use SAVE you create a fixed format, unless you insert commas. So, in your case your -READ command should be:
  
-READ  &vLENGTH.I5. &vWIDTH.I5. &vHEIGHT.I5.


I hope this makes it clear.


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

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Expert
posted Hide Post
&vars can contain decimals..which is swell..that happened several 7's ago...
so if you need your &vars to contain decimals,
you have to be sure you can actual export a text field that contains those decimals...
might take a little EDIT work up front on your source data. Give it a try




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
quote:
&vars can contain decimals

There's a setting to decide the precision.

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report 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     [CLOSED] READ feature Loading record fields into amper variables

Copyright © 1996-2020 Information Builders