Focal Point
[SOLVED] Creating a variable using a HOLD file

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

February 09, 2012, 10:04 AM
Jay Potter
[SOLVED] Creating a variable using a HOLD file
I am a Newbie. Confused

I am trying to create variables using a 1 record HOLD file.

I get the following error:

0 ERROR AT OR NEAR LINE 42 IN PROCEDURE invoice_detail_subsidiary_daily
(FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: COMPHOLD
0 ERROR AT OR NEAR LINE 43 IN PROCEDURE invoice_detail_sub
(FOC2907) ERROR WITH DIALOGUE MANAGER COMMAND: -READFILE COMPHOLD

Code that I am trying to run:

TABLE FILE COMPANY_LOCATION
PRINT
FFA_DAY_END
FFA_FISCAL_WEEK
FFA_FISCAL_PERIOD
FFA_FISCAL_YEAR
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE HOLD AS COMPHOLD
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
TYPE=REPORT,
GRAPHCOLOR='GREEN',
$
TYPE=REPORT,
OBJECT=MENU,
COLOR='WHITE',
HOVER-COLOR=RGB(66 70 73),
BACKCOLOR=RGB(102 102 102),
HOVER-BACKCOLOR=RGB(218 225 232),
BORDER-COLOR='WHITE',
$
TYPE=REPORT,
OBJECT=STATUS-AREA,
COLOR='WHITE',
BACKCOLOR=RGB(102 102 102),
$
TYPE=REPORT,
OBJECT=CURRENT-ROW,
HOVER-BACKCOLOR=RGB(218 225 232),
BACKCOLOR=RGB(200 200 200),
$
TYPE=REPORT,
OBJECT=CALC-AREA,
COLOR='WHITE',
BACKCOLOR=RGB(102 102 102),
$
ENDSTYLE
END
-READFILE COMPHOLD
-TYPE FFA_DAY_END IS &DE
-TYPE FFA_FISCAL_WEEK IS &FW
-TYPE FFA_FISCAL_PERIOD IS &FP
-TYPE FFA_FISCAL_YEAR IS &FY

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


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
February 09, 2012, 02:12 PM
Dan Satchell
You need a -RUN after the END statement and before the -READFILE.


WebFOCUS 7.7.05
February 09, 2012, 02:16 PM
njsden
In addition to Dan's comment, you will probably need to:

...
ON TABLE HOLD AS COMPHOLD FORMAT ALPHA
...


Otherwise you'll get a binary representation of the values, something Dialogue Manager (and you) may not be too happy about.

That is, of course, assuming your FFA_* fields are numeric. If they are all strings in your source data then you shouldn't have any issues by leaving the HOLD file as binary.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
February 09, 2012, 02:50 PM
Waz
Also to read from a file you need to:

-READ COMPHOLD &Var1.{format}. &Var1.{format}. etc  


format is typically Ann, where nnis the length of the string to get.

If you issue a ? HOLD COMPHOLD you will see the lengths of the fields.

Unless you are going to use the file COMPHOLD later in your fex, I would suggest using ON TABLE SAVE AS COMPHOLD, as this creates an alpha version of the file anyway, and also shows the field sizes in the output making it easier to work out the -READ.

There are may examples of this in the forum.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 09, 2012, 03:08 PM
njsden
Waz, Jay is using WF 7.7.x and the cool -READFILE feature added to it.

It makes -READing from HOLD files into &variables a walk in the park (provided there is a master file associated with it, of course).



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
February 09, 2012, 03:38 PM
Waz
Can't wait to upgrade.....

Big Grin


Been trying for a couple of years....

Frowner


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 09, 2012, 05:24 PM
njsden
I know the feeling ... I just moved to 7.7.03 in July last year, after about 4 years working with 5.3.4 Eeker

Actually, I'm not being fair. 5.3.4 was a very decent version and we managed to do interesting things with it at my last place.

Anyway, hope you'll be able to make an upgrade before WF 8.x Wink



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
February 09, 2012, 05:32 PM
Waz
We're moving to 7.6.11, and then probably 8, but when you look at how long its takes so far, it may be 9


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 09, 2012, 05:42 PM
njsden
quote:
... it may be 9






Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
February 09, 2012, 09:04 PM
susannah
jay, get rid of all that stylesheet noise..it has no part of this task.
I would have issued a -READ filename varname.size
i can't wait to upgrade and find out about this walk in the park -READFILE... tks new jersey!

quote:
TABLE FILE COMPANY_LOCATION
PRINT
FFA_DAY_END
FFA_FISCAL_WEEK
FFA_FISCAL_PERIOD
FFA_FISCAL_YEAR
ON TABLE HOLD AS COMPHOLD FORMAT ALPHA
END
-RUN





In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
February 10, 2012, 07:11 AM
Jay Potter
Thank You for all the comments. It helped me go in the right direction.


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
February 10, 2012, 07:19 AM
Jay Potter
I did take the noise out.It was one of those things that Dev Studio like to add,

Thanks again


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
February 10, 2012, 09:19 AM
j.gross
quote:
-READFILE COMPHOLD
-TYPE FFA_DAY_END IS &DE


READFILE -- nifty as it is -- is not a mind-reader. The value of FFA_DAY_END will be placed in &FFA_DAY_END


- Jack Gross
WF through 8.1.05
February 10, 2012, 11:41 AM
George Patton
Right on Susannah ! Styling should be saved for final output IMHO.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
February 10, 2012, 11:51 AM
njsden
I've found the GUI tools in 7.7.03M doing a more decent job than in previous versions (particularly the Synonym Editor and the JOIN /MATCH Tool) so I'm seeing myself using the GUI to scaffold my reports more frequently than in the past.

Dev Studio's Report Painter could do a better job at *not* adding any STYLE statements (which susannah accurately calls "noise") when choosing a non-styled output format such as HOLD BINARY, HOLD ALPHA, HOLD FOCUS, etc.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
February 10, 2012, 12:31 PM
M Meagher
I found this in the online help for 7.7.03:

TABLE FILE EMPLOYEE                           
PRINT LAST_NAME FIRST_NAME DEPARTMENT CURR_SAL
BY EMP_ID                                     
ON TABLE HOLD AS READF1 FORMAT BINARY         
END                                           
-RUN                                          
-READFILE READF1                              
-TYPE LAST_NAME  IS &LAST_NAME                
-TYPE FIRST_NAME IS &FIRST_NAME               
-TYPE DEPARTMENT IS &DEPARTMENT               
-TYPE CURR_SAL   IS &CURR_SAL                 
-TYPE EMP_ID     IS &EMP_ID


They used BINARY.
February 10, 2012, 12:51 PM
susannah
"scaffold"...perfect word!




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
February 10, 2012, 03:20 PM
njsden
quote:
They used BINARY.


Wow! I hadn't figured that out so our old trick of HOLDing ALPHA is no longer a must when reading values into &variables. -READFILE really was a nice addition to Dialogue Manager!



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.