Focal Point
[SOLVED] HELP with -READ

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

May 30, 2013, 06:30 PM
globalwm
[SOLVED] HELP with -READ
I'm seeing a error in a report where it seems to be combining two values into the same variable.

It should be reading a file of "BUDG_CODE" that contains:

690
692
694
696
697
780

which is created by this code:
 
TABLE FILE EXHB21A
SUM MAX.BUDGET_UNIT_CODE
BY BUDGET_UNIT_CODE NOPRINT
ON TABLE SAVE AS BUDG_CODE FORMAT ALPHA
END
-RUN
 

However, when it runs, it is displaying an error showing:
 
WHERE BUDGET_UNIT_CODE EQ '690         692         ';
 

when the code calls for:
 
WHERE BUDGET_UNIT_CODE EQ '&BUDGET';
 


which appears to be appending the values in line 1 and 2 of BUDG_CODE.

It is consumed by following code:
 
-* Outer loop for Budget Units.
-REPEAT :End_Report FOR &M FROM 1 TO &BUD_NO;
-READ BUDG_CODE NOCLOSE &BUDGET.A24.

TABLE FILE EXHB21a
SUM
     Col_1
     Col_2
     Col_5
     Col_6
     Col_9
     Col_10
     BUDGET_UNIT_DESC
	 BUDGET_UNIT_CODE
BY  Sort_Ord ROWS '1' OVER '2' OVER '4' OVER '5'
BY COL5_SORT
BY  N_DESC3
WHERE BUDGET_UNIT_CODE EQ '&BUDGET';
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS EXBH21A_1 FORMAT ALPHA
END
-RUN
 


Any ideas?

I thought I'd might mention that I'm modifying a report that runs fine in Production (8001) in our Development (8002) environment.

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


8.0.02M, Oracle 11.2 (AIX), Windows 2008R2, HTML, PDF, Excel
May 30, 2013, 07:00 PM
globalwm
I have also verified "SET VARCHAR OFF" in my EDASPROF...
May 30, 2013, 07:26 PM
David Briars
WHERE BUDGET_UNIT_CODE EQ '690         692         ';
                           123456789012123456789012

Judging by the results you show, BudgetUnitCode is stored in the SAVE file, as an A12, but the recordlayout in your -READ says to read 24 positions.

This message has been edited. Last edited by: David Briars,
May 31, 2013, 08:15 AM
FrankDutch
You mix the read and the 'in file' functionality.

In this case the where statement should be

WHERE BUDGETUNITCODE IN FILE EXBH21A ;




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

May 31, 2013, 09:42 AM
globalwm
Thanks David - that was what has fixed it. I changed from A24 to A12:

 
-READ BUDG_CODE NOCLOSE &BUDGET.A12.
 


Strange, it didn't seem to be a problem in 8001 code version. I will testing this code change in 8001 and report back.

Thanks all for starting my Friday off good. Smiler
May 31, 2013, 10:10 AM
globalwm
Testing: I dragged the FEX from my 8002 environment to my 8001 environment in Dev Studio and while it produces a report in 8002, in 8001 it displays an error:

 
(FOC3209) UNKNOWN KEYWORD IN STYLESHEET FILE AT LINE 533
(FOC009) INCOMPLETE REQUEST STATEMENT
 


Lines 530-535 looks like:
  
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
TYPE=REPORT,
     TOPGAP=0.015,


while the raw table data is displayed in one "blob" on the screen...
May 31, 2013, 11:04 AM
globalwm
Just finished my testing. In 8001 the (sloppy) code is allowed to process as a "24" - however, in 8002 it must be consistent (12).

I might raise this issue with IBI just to make sure this is expected behavior.
May 31, 2013, 11:08 AM
globalwm
Oh, to get around the other errors (stylesheet), I had to use the Migration tool. Then the same code ran fine. That was strange as well but it could be caused by running 8002 Dev Studio and copying to 8001 environments.
May 31, 2013, 11:21 AM
Tim P.
It depends on the situation, I have run into format errors when reading from a table many times.

We eventually found the command '-READFILE' where the formats are taken from the table itself so you don't have to individually format each variable. The only potential issue is '-READFILE' called it's variables whatever you called the fields in the table in sequential order so you have to be careful not to overwrite something.

Basically:

-READFILE HOLD_TEST

Instead of
-READ HOLD_TEST SOME_SOLUMN.A12 OTHER COLUMN.A12 ETC....

We never went back to '-READ'


WebFOCUS App Studio 8.2.02
Windows 7, All Outputs
May 31, 2013, 12:12 PM
globalwm
Thanks Tim. Lots to absorb and test.
May 31, 2013, 12:42 PM
j.gross
Regarding -READFILE

1. A recent client insisted on camelCased names for amper vars. To rename a data column as a mixed-case string (to match the target amper var), as in
RCOST AS 'RetailCost'
,
it is essential to have
SET ASNAMES = MIXED

in effect (whether at the session or TABLE level).

2. I habitually give the HOLD file a ddname matching the target amper var (or one of them). Several human-factors benefits.

3. Don't forget -RUN between the "Table ... Hold" request and the -READFILE

4. Note that -READFILE can be used in a loop to read successive rows of the hold file into the (same) amper vars. (You may want to -CLOSE the file once you are through with it.)


- Jack Gross
WF through 8.1.05