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     [CLOSED] how to define a hold file inside a TABLE command
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] how to define a hold file inside a TABLE command
 Login/Join
 
Gold member
posted
can we dynamically define the hold file inside a TABLE command so that when the report runs it will save each record in separate file with different user defined names

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


WebFocus 5.2.5
HP-UX(UNIX)
EXCEL, HTML, PDF and OLAP
 
Posts: 50 | Registered: August 04, 2009Reply With QuoteReport This Post
Virtuoso
posted Hide Post
No, you can't.


GamP

- Using AS 8.2.01 on Windows 7 - IE11.
in Focus since 1988
 
Posts: 1960 | Location: Netherlands | Registered: September 25, 2007Reply With QuoteReport This Post
Gold member
posted Hide Post
Is there any other solution for below situation
i have a example situation like below

  TABLE FILE CAR
PRINT BODYTYPE
ON TABLE HOLD AS BDY_TYPE FORMAT ALPHA
END
-RUN
TABLE FILE CAR
PRINT BODYTYPE RETAIL_COST SALES
WHERE BODYTYPE IN FILE BDY_TYPE
ON TABLE SET ONLINE-FMT PDF
END
-RUN
-EXIT


and i would like to print retail_cost and sales for each bodytype in different files, and save it to disk. I know about PAGE-BREAK, but it creates report in same file different page, but i need the report to be in different file.


WebFocus 5.2.5
HP-UX(UNIX)
EXCEL, HTML, PDF and OLAP
 
Posts: 50 | Registered: August 04, 2009Reply With QuoteReport This Post
Expert
posted Hide Post
You can use PUTDDREC - an oft overlooked function - to output records into a file from within a table request.

You MUST filedef the output files beforehand.

FILEDEF RCOST DISK OUT1.TXT
FILEDEF SALES DISK OUT2.TXT
-RUN
TABLE FILE CAR
BY BODYTYPE
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS BDYTYPE
END
-RUN
TABLE FILE CAR
PRINT COMPUTE RCOSTA/A12 = FTOA(RETAIL_COST, '(D7)', 'A12');
      COMPUTE SALESA/A12 = FTOA(SALES, '(D6)', 'A12');
      COMPUTE OUT1/I11 = PUTDDREC('RCOST', 5, RCOSTA, 12, OUT1);
      COMPUTE OUT2/I11 = PUTDDREC('SALES', 5, SALESA, 12, OUT2);
WHERE BODYTYPE IN FILE BDYTYPE
ON TABLE SAVE
END
-RUN
CMD TYPE OUT*.TXT

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5616 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Gold member
posted Hide Post
unlucky PUTDDREC is not available in 5.2 version.


WebFocus 5.2.5
HP-UX(UNIX)
EXCEL, HTML, PDF and OLAP
 
Posts: 50 | Registered: August 04, 2009Reply With QuoteReport This Post
Expert
posted Hide Post
Time to push for that upgrade? Especially as 5.2.5 is now relatively old - is it "functionally stabalised" yet?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5616 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
<JG>
posted
quote:
is it "functionally stabalised" yet?

Very. May 2007 to be exact.

The old fashioned way

 
TABLE FILE CAR
BY COUNTRY
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS FILELIST
END
-RUN
-SET &LOOP=&LINES;
-REPEAT ENDLOOP &LOOP TIMES
-READ FILELIST NOCLOSE &COUNTRY.A10.
FILEDEF DEST DISK &COUNTRY.EVAL.FTM
-RUN
TABLE FILE CAR 
PRINT DCOST  RCOST
BY COUNTRY
WHERE COUNTRY EQ '&COUNTRY'
ON TABLE SAVE AS DEST
END
-ENDLOOP
 
 
Reply With QuoteReport This Post
Gold member
posted Hide Post
I believe there should be some way out. It's a simple requirement.

"Table file" command itself would create the report in different file and store with different name, after all the "table file" can create all report in same file with PAGE-BREAK.

I am searching hard, will keep this discussion, updated.


WebFocus 5.2.5
HP-UX(UNIX)
EXCEL, HTML, PDF and OLAP
 
Posts: 50 | Registered: August 04, 2009Reply With QuoteReport This Post
Master
posted Hide Post
I'm a bit foggy on this but I seem to recollect using something like this in the past, with IN and the HOLD in brackets:

TABLE FILE CAR
PRINT BODYTYPE
ON TABLE HOLD
END
-RUN
TABLE FILE CAR
PRINT BODYTYPE RETAIL_COST SALES
WHERE BODYTYPE IN (HOLD)
ON TABLE SET ONLINE-FMT PDF
END


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Reply With QuoteReport This Post
Master
posted Hide Post
CORRECTION!!

WHERE BODYTYPE IN (HOLD)

should be

WHERE BODYTYPE EQ (HOLD)

This produces:

BODYTYPE RETAIL_COST SALES
CONVERTIBLE 8,878 0
SEDAN 13,491 12000
SEDAN 17,850 20
SEDAN 3,139 43000
COUPE 31,500 0
SEDAN 3,339 35030
SEDAN 5,970 7800
HARDTOP 5,100 0
SEDAN 5,925 4800
ROADSTER 6,820 13000
COUPE 6,820 12400
SEDAN 5,940 8950
SEDAN 6,355 8900
SEDAN 9,097 14000
SEDAN 9,495 15600
SEDAN 13,752 14000
SEDAN 14,123 18940
SEDAN 5,610 0


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Why use HOLD when you can use SAVE

TABLE FILE CAR
PRINT BODYTYPE
ON TABLE SAVE
END
-RUN
TABLE FILE CAR
PRINT BODYTYPE RETAIL_COST SALES
WHERE BODYTYPE IN (SAVE)
OR
IF BODYTYPE EQ (SAVE)
ON TABLE SET ONLINE-FMT PDF
END

WHERE BODYTYPE EQ (SAVE) will not work.
 
Posts: 142 | Location: Adelaide South Australia | Registered: October 27, 2006Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Opaltosh,

Your logic is working fine when i am using only IF condition. When i am giving only WHERE condition, it is throwing error.

FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: HOLD

Could you please help me with the above error.


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
 
Posts: 135 | Registered: November 30, 2010Reply With QuoteReport This Post
<JG>
posted
That is because the syntax for WHERE is wrong in the example.

IF BODYTYPE IN (SAVE) is correct

WHERE syntax is

WHERE BODYTYPE IN FILE
 
Reply With QuoteReport This Post
Platinum Member
posted Hide Post
The below code also worked for me.
IF EID EQ (SAVE)

The WHERE clause you have mentioned in the above post would be in the format WHERE BODYTYPE IN FILE SAVE, this worked for me.

Thanks JG.


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
 
Posts: 135 | Registered: November 30, 2010Reply With QuoteReport This Post
Platinum Member
posted Hide Post
My point was that using HOLD and WHERE is more complicated than using SAVE and IF.

Creating a HOLD file also creates a MAS file which is redundant. SAVE is all that is requred for this scenario.

And why use WHERE ... IN FILE SAVE
when IF ... EQ (SAVE) works.

KISS (keep it simple stupid)
 
Posts: 142 | Location: Adelaide South Australia | Registered: October 27, 2006Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] how to define a hold file inside a TABLE command

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