Focal Point
[SOLVED] Unable to read Hold amper variable.

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

April 09, 2009, 01:13 PM
Santhu
[SOLVED] Unable to read Hold amper variable.
DEFINE FILE EXCHANGE_TABLE
CURR_RATE/P17.8 = 1/CURRENCY_RATE;
END
TABLE FILE HOLD_PREV
PRINT
CURR_RATE
WHERE READLIMIT EQ 1
ON TABLE HOLD AS HOLDRATE1
END
-RUN

-READ HOLDRATE1 &CURR_RATE.
-TYPE &CURR_RATE

I am unable to read hold value into ampervariable(&CURR_RATE) i tried by giving &CURR_RATE.A15. and checked, But there is no result.

Do we have solution for this.

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


WebFOCUS 8.0.0.7 App Studio
April 09, 2009, 01:22 PM
Prarie
You don't have an &CURR_RATE. You have a Defined field called CURR_RATE.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
quote:
DEFINE FILE EXCHANGE_TABLE
CURR_RATE/P17.8 = 1/CURRENCY_RATE;
END
TABLE FILE HOLD_PREV
PRINT
CURR_RATE
WHERE READLIMIT EQ 1
ON TABLE SAVE AS HOLDRATE1
END
-RUN

-READ HOLDRATE1, &CURR_RATE
-TYPE &CURR_RATE

I know this one, is easy. Use SAVE not HOLD no need master. Use , no need A15. I found using search Smiler

Kofi


Client Server 8.1.05: Apache; Tomcat;Windows Server 2012
Reporting Server 8.1.05; Oracle; MS SQL; Windows Server 2012
Thanks Kofi...I didn't read it right.
Super Kofi,
Thanks for replying...

I tried like THIS

ON TABLE HOLD AS HOLDRATE1
END
-RUN

-READ HOLDRATE1, &CURR_RATE
-TYPE &CURR_RATE

And can i know the difference between SAVE and HOLD.


WebFOCUS 8.0.0.7 App Studio
If you insist on using HOLD,

ON TABLE HOLD AS HOLDRATE1 FORMAT ALPHA
END
-RUN

READ HOLDRATE1 &CURR_RATE.A17.
-TYPE &CURR_RATE

Kofi's suggestion also works:

ON TABLE SAVE AS HOLDRATE1
END
-RUN

-READ HOLDRATE1, &CURR_RATE
-TYPE &CURR_RATE

SAVE holds ALPHA, HOLD holds BINARY.


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
Santhu,

I help I learn, I search and find answer. HOLD give master SAVE not. SAVE give ALPHA, Tom say HOLD give not ALPHA unless you say.

I like Focal Forum, help learn Smiler also help me engrish

Kofi


Client Server 8.1.05: Apache; Tomcat;Windows Server 2012
Reporting Server 8.1.05; Oracle; MS SQL; Windows Server 2012
Kofi,

Focal Point has saved me many times! I like it too.

I'm trying to do the same thing but with multiple fields. However, when I read the values into AmperVariables they do not come out right.

My first variable reads OK but the second one starts reading from the beginning of the file again. What am I doing wrong?
  
TABLE FILE CAR 
SUM RETAIL_COST/P13 DEALER_COST/P13
ON TABLE SAVE 
END 
-RUN 
-READ SAVE &RETAIL_COST.A13. &DEALER_COST.A13
TABLE FILE CAR
SUM RETAIL_COST/P13 DEALER_COST/P13
HEADING
"&RETAIL_COST  -  &DEALER_COST"
END


Thanks!

Dan


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
Dan,

You should only use column/format for "display only". If you do

ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END
-RUN
?FF HOLD1

You will have 2 columns for each, the 1st with the database formats, the second with reformatted columns; Maybe, that's what you wnat.

You can do a COMPUTE/DEFINE like the following:
 
DEFINE FILE CAR
RETAIL_COST1/P13 = RETAIL_COST;
DEALER_COST1/P13 = DEALER_COST;
END
TABLE FILE CAR 
SUM RETAIL_COST1 DEALER_COST1
ON TABLE SAVE 
END 
-RUN 
-READ SAVE &RETAIL_COST.A13. &DEALER_COST.A13
TABLE FILE CAR
SUM RETAIL_COST/P13 DEALER_COST/P13
HEADING
"&RETAIL_COST  -  &DEALER_COST"
END
-EXIT


Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
DOH!

I knew I was missing a step. Music

Thanks Tom!


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
Or add ON TABLE SET HOLDLIST PRINTONLY to your request.


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
Yep, Ginny's correct! Smiler

I always forget about that one, probably, because I haven't used it. Financial stuff is a bit more complex than CAR...

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe