Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Dash READFILE Doesn't read all variables
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Dash READFILE Doesn't read all variables
 Login/Join
 
Guru
posted
In the example below, only the last variable is set using READFILE.

This should work, I copied it from another procedure, but something is wrong and I just can't find it. Hoping for a an idea or two.

Thanks in advance.


 -SET &ECHO = ALL;

-DEFAULTH &CURRENT_VALUE = _FOC_NULL;
-DEFAULTH &LAST_VALUE = _FOC_NULL;
-DEFAULTH &PAST_VALUE = _FOC_NULL;

DEFINE FILE CAR
DISPINNETCNTCM/I11 = IF COUNTRY EQ 'ENGLAND' THEN DEALER_COST ELSE 0;
DISPINNETCNTLM/I11 = IF COUNTRY EQ 'JAPAN' THEN RETAIL_COST ELSE 0;
DISPINNETCNT3M/I11 = IF COUNTRY EQ 'ITALY' THEN RETAIL_COST+10 ELSE 0;
END
TABLE FILE CAR
SUM

	COMPUTE CURRENT_MONTH/A20 = FTOA((DISPINNETCNTCM / SALES) * 100,'(D18.4)','A20');
	COMPUTE LAST_MONTH/A20    = FTOA((DISPINNETCNTLM / SALES) * 100,'(D18.4)','A20');
	COMPUTE PAST_VALUE/A20    = FTOA((DISPINNETCNT3M / SALES) * 100,'(D18.4)','A20');
-*
BY CAR 
-*
-*
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE HOLD AS HOLDSUMM
END
-RUN
-*
-READFILE  HOLDSUMM
-SET CURRENT_VALUE = &CURRENT_VALUE;
-SET LAST_VALUE = &LAST_VALUE;
-SET PAST_VALUE = &PAST_VALUE; 

This message has been edited. Last edited by: Don Garland,


Senior Business Intelligence Analyst (BIA) @ Enclara Pharmacia
Production: WF 8.09, App Studio, BIP, RC, MSSQL / Test: WF 8204, App Studio, BIP, Reportcaster, Resource Manager, MSSQL
 
Posts: 290 | Location: Greater Cincinnati  | Registered: May 11, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Could you try it with HOLD FORMAT ALPHA?


WebFOCUS 8206, Unix, Windows
 
Posts: 1659 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Guru
posted Hide Post
quote:
HOLD FORMAT ALPHA?


That was my first thought, but it didn't change the outcome. I also thought that maybe those DEFINEd fields were not fully realized in the matrix for some reason, so I held the file than ran the computes, but still, no luck.

OUTPUT FROM ORIGINAL PROCEDURE
 -DEFAULTH &CURRENT_VALUE = _FOC_NULL;
 -DEFAULTH &LAST_VALUE = _FOC_NULL;
 -DEFAULTH &PAST_VALUE = _FOC_NULL;
 DEFINE FILE CAR
 DISPINNETCNTCM/I11 = IF COUNTRY EQ 'ENGLAND' THEN DEALER_COST ELSE 0;
 DISPINNETCNTLM/I11 = IF COUNTRY EQ 'JAPAN' THEN RETAIL_COST ELSE 0;
 DISPINNETCNT3M/I11 = IF COUNTRY EQ 'ITALY' THEN RETAIL_COST+10 ELSE 0;
 END
 TABLE FILE CAR
 SUM
 COMPUTE CURRENT_MONTH/A20 = FTOA((DISPINNETCNTCM / SALES) * 100,'(D18.4)','A20');
 COMPUTE LAST_MONTH/A20    = FTOA((DISPINNETCNTLM / SALES) * 100,'(D18.4)','A20');
 COMPUTE PAST_VALUE/A20    = FTOA((DISPINNETCNT3M / SALES) * 100,'(D18.4)','A20');
 -*
 BY CAR
 -*
 -*
 ON TABLE SET PAGE-NUM NOLEAD
 ON TABLE SET ASNAMES ON
 ON TABLE NOTOTAL
 ON TABLE HOLD AS HOLDSUMM FORMAT ALPHA
 END
 -RUN
 0 NUMBER OF RECORDS IN TABLE=       18  LINES=     10
 (FOC2906)  WARNING: &PAST_VALUE WILL BE OVERWRITTEN BY -READFILE HOLDSUMM
 -READFILE  HOLDSUMM
 -SET CURRENT_VALUE = _FOC_NULL;
 -SET LAST_VALUE = _FOC_NULL;
 -SET PAST_VALUE =                64.88;

  



HOLD VERSION

 -SET &ECHO = ALL;

-DEFAULTH &CURRENT_VALUE = _FOC_NULL;
-DEFAULTH &LAST_VALUE = _FOC_NULL;
-DEFAULTH &PAST_VALUE = _FOC_NULL;

DEFINE FILE CAR
DISPINNETCNTCM/I11 = IF COUNTRY EQ 'ENGLAND' THEN DEALER_COST ELSE 0;
DISPINNETCNTLM/I11 = IF COUNTRY EQ 'JAPAN' THEN RETAIL_COST ELSE 0;
DISPINNETCNT3M/I11 = IF COUNTRY EQ 'ITALY' THEN RETAIL_COST+10 ELSE 0;
END
TABLE FILE CAR
SUM
SALES
DISPINNETCNTCM 
DISPINNETCNTLM 
DISPINNETCNT3M 
-*
BY CAR 
-*
-*
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE HOLD AS HOLDSUMM FORMAT ALPHA
END
-RUN
-*
TABLE FILE HOLDSUMM
SUM

	COMPUTE CURRENT_MONTH/A20 = FTOA((DISPINNETCNTCM / SALES) * 100,'(D18.4)','A20');
	COMPUTE LAST_MONTH/A20    = FTOA((DISPINNETCNTLM / SALES) * 100,'(D18.4)','A20');
	COMPUTE PAST_VALUE/A20    = FTOA((DISPINNETCNT3M / SALES) * 100,'(D18.4)','A20');
ON TABLE HOLD AS HOLDSUMM FORMAT ALPHA
END
-RUN
-*
-READFILE  HOLDSUMM
-SET CURRENT_VALUE = &CURRENT_VALUE;
-SET LAST_VALUE = &LAST_VALUE;
-SET PAST_VALUE = &PAST_VALUE; 


OUTPUT FROM THE HOLD VERSION
 -DEFAULTH &CURRENT_VALUE = _FOC_NULL;
 -DEFAULTH &LAST_VALUE = _FOC_NULL;
 -DEFAULTH &PAST_VALUE = _FOC_NULL;
 DEFINE FILE CAR
 DISPINNETCNTCM/I11 = IF COUNTRY EQ 'ENGLAND' THEN DEALER_COST ELSE 0;
 DISPINNETCNTLM/I11 = IF COUNTRY EQ 'JAPAN' THEN RETAIL_COST ELSE 0;
 DISPINNETCNT3M/I11 = IF COUNTRY EQ 'ITALY' THEN RETAIL_COST+10 ELSE 0;
 END
 TABLE FILE CAR
 SUM
 SALES
 DISPINNETCNTCM
 DISPINNETCNTLM
 DISPINNETCNT3M
 -*
 BY CAR
 -*
 -*
 ON TABLE SET PAGE-NUM NOLEAD
 ON TABLE SET ASNAMES ON
 ON TABLE NOTOTAL
 ON TABLE HOLD AS HOLDSUMM FORMAT ALPHA
 END
 -RUN
 0 NUMBER OF RECORDS IN TABLE=       18  LINES=     10
 -*
 TABLE FILE HOLDSUMM
 SUM
 COMPUTE CURRENT_MONTH/A20 = FTOA((DISPINNETCNTCM / SALES) * 100,'(D18.4)','A20');
 COMPUTE LAST_MONTH/A20    = FTOA((DISPINNETCNTLM / SALES) * 100,'(D18.4)','A20');
 COMPUTE PAST_VALUE/A20    = FTOA((DISPINNETCNT3M / SALES) * 100,'(D18.4)','A20');
 ON TABLE HOLD AS HOLDSUMM FORMAT ALPHA
 END
 -RUN
 0 NUMBER OF RECORDS IN TABLE=       10  LINES=      1
 -*
 (FOC2906)  WARNING: &PAST_VALUE WILL BE OVERWRITTEN BY -READFILE HOLDSUMM
 -READFILE  HOLDSUMM
 -SET CURRENT_VALUE = _FOC_NULL;
 -SET LAST_VALUE = _FOC_NULL;
 -SET PAST_VALUE =                24.52;
 


Senior Business Intelligence Analyst (BIA) @ Enclara Pharmacia
Production: WF 8.09, App Studio, BIP, RC, MSSQL / Test: WF 8204, App Studio, BIP, Reportcaster, Resource Manager, MSSQL
 
Posts: 290 | Location: Greater Cincinnati  | Registered: May 11, 2005Reply With QuoteReport This Post
Guru
posted Hide Post
ARRRGGGGG! The FIELDs don't match.


Senior Business Intelligence Analyst (BIA) @ Enclara Pharmacia
Production: WF 8.09, App Studio, BIP, RC, MSSQL / Test: WF 8204, App Studio, BIP, Reportcaster, Resource Manager, MSSQL
 
Posts: 290 | Location: Greater Cincinnati  | Registered: May 11, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
quote:
TABLE FILE CAR
SUM

COMPUTE CURRENT_MONTH/A20 = FTOA((DISPINNETCNTCM / SALES) * 100,'(D18.4)','A20');
COMPUTE LAST_MONTH/A20 = FTOA((DISPINNETCNTLM / SALES) * 100,'(D18.4)','A20');
COMPUTE PAST_VALUE/A20 = FTOA((DISPINNETCNT3M / SALES) * 100,'(D18.4)','A20');
-*
BY CAR
-*
-*
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE HOLD AS HOLDSUMM
END
-RUN
-*
-READFILE HOLDSUMM
-SET CURRENT_VALUE = &CURRENT_VALUE;
-SET LAST_VALUE = &LAST_VALUE;
-SET PAST_VALUE = &PAST_VALUE;


Two of the names in the RHS of the -SET commands (CURRENT_VALUE, LAST_VALUE) do not match those in your COMPUTEs,so they are unaffected by the READFILE.

Add a ?FF HOLDSUMM to display the columns of the hold file. All fields referenced in the COMPUTE formulas will be treated as implied NOPRINT verb objects, and will normally be included in the Hold layout.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
quote:

(FOC2906) WARNING: &PAST_VALUE WILL BE OVERWRITTEN BY -READFILE HOLDSUMM


If you place you -DEFAULT statements after the -READFILE, you'll avoid those warnings.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Reply With QuoteReport This Post
Guru
posted Hide Post
Hmmm, Is that an 8.1 thing? I'm still getting them in 8009. Also, had to turn off prompting to user
-DEFAULT
.

-*WHERE &WFUSERNAME EQ &IBIMR_user;  &CANCEL_WFUSERNAME_FILTER
WHERE I_YEARMONTH_NUM EQ 201803;
WHERE CORPORATEORGID  EQ _FOC_NULL;
WHERE HOSPICEORGID    EQ _FOC_NULL;
WHERE BUSINESSMODEL   EQ '_FOC_NULL';
-*
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE HOLD AS HOLDSUMM
END
-RUN
0 NUMBER OF RECORDS IN TABLE=        1  LINES=      1
-*
(FOC2906)  WARNING: &I_YEARMONTH_NUM WILL BE OVERWRITTEN BY -READFILE HOLDSUMM
(FOC2906)  WARNING: &CURRENT_VALUE WILL BE OVERWRITTEN BY -READFILE HOLDSUMM
(FOC2906)  WARNING: &LAST_VALUE WILL BE OVERWRITTEN BY -READFILE HOLDSUMM
(FOC2906)  WARNING: &PAST_VALUE WILL BE OVERWRITTEN BY -READFILE HOLDSUMM
-READFILE  HOLDSUMM
-*
-DEFAULT &CURRENT_VALUE = _FOC_NULL
-DEFAULT &LAST_VALUE    = _FOC_NULL
-DEFAULT &PAST_VALUE    = _FOC_NULL
-*
-SET CURRENT_VALUE =                 9.45;
-SET LAST_VALUE =                71.32;
-SET PAST_VALUE =                61.36;
-*
-SET &CURRENT_VALUE =                 9.45|'%';
-SET &LAST_VALUE =                71.32|'%';
-SET &PAST_VALUE =                61.36|'%';  

This message has been edited. Last edited by: Don Garland,


Senior Business Intelligence Analyst (BIA) @ Enclara Pharmacia
Production: WF 8.09, App Studio, BIP, RC, MSSQL / Test: WF 8204, App Studio, BIP, Reportcaster, Resource Manager, MSSQL
 
Posts: 290 | Location: Greater Cincinnati  | Registered: May 11, 2005Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Dash READFILE Doesn't read all variables

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.