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 D5This message has been edited. Last edited by: Kerry,
Webfocus 7.6.6 Solaris 10 Sparc 64bit
May 12, 2009, 02:11 PM
GinnyJakes
Try ON TABLE HOLD FORMAT ALPHA. The WebFOCUS default for a hold file is binary.
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
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
May 14, 2009, 12:50 AM
TexasStingray
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
May 14, 2009, 02:13 AM
Tony A
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
May 14, 2009, 03:08 AM
Danny-SRL
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
May 14, 2009, 11:10 AM
susannah
&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
May 14, 2009, 01:43 PM
Tony A
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