Focal Point
Using values from HOLD file

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

November 15, 2007, 03:41 AM
Deepa497
Using values from HOLD file
Hi,

I am creating a HOLD file as HOLD1 as follows:


TABLE FILE abc
SUM
field1
BY field2
ACROSS field3
ON TABLE HOLD AS HOLD1
END
-RUN

The output is like:

field2 A B C D E

R1 100 200 300 400 500
R2
R3
R4


Now I want to define a field from HOLD1 which should add values corresponding to B and D.Finally to print
values A C E and defined field.


I am trying the following but I am getting error:

DEFINE FILE HOLD1
MISC/P20.2MBC = B + D;
END

TABLE FILE HOLD1
PRINT LVL_1_ABBR_N
PRINT MISC
------


Could you please help me?

Thanks
Deep


WebFocus 7.1.4, Windows Server 2005 , HTML/EXL/PDF
November 15, 2007, 05:11 AM
Tony A
Deep,

Get used to looking at the structure of HOLD files to help you through this type of question. You can use !TYPE HOLD1.MAS in your example to see the field names etc.

Then once you know that info then you can identify how to achieve what you need -

!TYPE HOLD1.MAS
TABLE FILE HOLD1
SUM COMPUTE BnD/I9 = E03 + E05;
    E02 AS 'A'
    E04 AS 'C'
    E06 AS 'E'
BY E01
END

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
November 15, 2007, 04:05 PM
jimster06
Or
? HOLD HOLD1


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K
November 15, 2007, 04:10 PM
Francis Mariani
quote:
!TYPE HOLD1.MAS


That's a new one for me!


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
November 15, 2007, 04:43 PM
FrankDutch
For me too, I always used ? hold...




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

November 15, 2007, 05:17 PM
Tom Flynn
Tony,

Using your !TYPE, I get the following (7.6.1)

APP HOLD EXAMPLES
-RUN ? PATH
FILEDEF TESTDATA DISK C:\IBI\APPS\EXAMPLES\TESTDATA.TXT
-RUN
BASEAPP = C:\ibi\apps\baseapp;
APPHOLD = C:\ibi\apps\examples;
APPPATH = C:\ibi\apps\ibisamp;
C:\ibi\apps\baseapp;
C:\ibi\apps\examples;
? FILEDEF
SET ASNAMES=ON
TABLE FILE TESTDATA
LIST
T_GIFT
BY T_ACCT
BY HIGHEST T_DATE
ON TABLE HOLD AS H1
END
-RUN
Lname Device Lrecl Recfm Append Filename
============================================================
TESTDATA DISK 0 V C:\IBI\APPS\EXAMPLES\TESTDATA.
TXT
0 NUMBER OF RECORDS IN TABLE= 26 LINES= 26
!TYPE H1.MAS
-EXIT
The system cannot find the file specified.


But, when I ?FF H1, I get:

APP HOLD EXAMPLES
-RUN
? PATH
FILEDEF TESTDATA DISK C:\IBI\APPS\EXAMPLES\TESTDATA.TXT
-RUN
BASEAPP = C:\ibi\apps\baseapp;
APPHOLD = C:\ibi\apps\examples;
APPPATH = C:\ibi\apps\ibisamp;
C:\ibi\apps\baseapp;
C:\ibi\apps\examples;
? FILEDEF
SET ASNAMES=ON
TABLE FILE TESTDATA
LIST
T_GIFT
BY T_ACCT
BY HIGHEST T_DATE
ON TABLE HOLD AS H1
END
-RUN
Lname Device Lrecl Recfm Append Filename
============================================================
TESTDATA DISK 0 V C:\IBI\APPS\EXAMPLES\TESTDATA.
TXT
0 NUMBER OF RECORDS IN TABLE= 26 LINES= 26
?FF H1
-EXIT
  
FILENAME=  H1
 T_ACCT        E01           A04
 T_DATE        E02           YYMD
 LIST          E03           I5
 T_GIFT        E04           D12.2

How does !TYPE work for you, I thought ! was a shortcut for UNIX???


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
November 15, 2007, 05:57 PM
Tony A
Tom,

As has been mentioned before Wink the plink "!" is the shorthand for a system command. In windoze you can use either ! or CMD and as such ! TYPE filename.mas would dump the contents of the .mas file to the "sysout". As a consequence you see much more than ?FF filename gives you.

At the end of the day, it's down to personal preference and the occasion. There are times that I use CMD TYPE filename.mas and others when I would use ?FF filename. In this instance I suggested ! TYPE or CMD TYPE to give more info about the structure of the hold file, that's all.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
November 15, 2007, 06:13 PM
Tom Flynn
T,

Thanks for the clarification. Unfortunately, I keep getting:

The system cannot find the file specified.

Oh well, stick with ?FF

Again, THANKS!


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
November 16, 2007, 02:34 AM
Tony A
Tom,

Using this code -
TABLE FILE CAR
SUM RCOST
    DCOST
 BY COUNTRY
SUM RCOST
    DCOST
 BY COUNTRY
 BY CAR
ON TABLE HOLD AS HOLD1
END
-RUN
?FF HOLD1
CMD TYPE HOLD1.MAS
! TYPE HOLD1.MAS

I get this output -
 NUMBER OF RECORDS IN TABLE=       18  LINES=     10
 FILENAME=  HOLD1
 COUNTRY       E01           A10
 RETAIL_COST   E02           D7
 DEALER_COST   E03           D7
 CAR           E04           A16
 RETAIL_COST   E05           D7
 DEALER_COST   E06           D7
 FILENAME=HOLD1   , SUFFIX=FIX     , $
 SEGMENT=HOLD1, SEGTYPE=S1, $
 FIELDNAME=COUNTRY, ALIAS=E01, USAGE=A10, ACTUAL=A12,
 MISSING=ON, $
 FIELDNAME=RETAIL_COST, ALIAS=E02, USAGE=D7, ACTUAL=D08,
 MISSING=ON, $
 FIELDNAME=DEALER_COST, ALIAS=E03, USAGE=D7, ACTUAL=D08,
 MISSING=ON, $
 FIELDNAME=CAR, ALIAS=E04, USAGE=A16, ACTUAL=A16,
 MISSING=ON, $
 FIELDNAME=RETAIL_COST, ALIAS=E05, USAGE=D7, ACTUAL=D08,
 MISSING=ON, $
 FIELDNAME=DEALER_COST, ALIAS=E06, USAGE=D7, ACTUAL=D08,
 MISSING=ON, $
 FILENAME=HOLD1   , SUFFIX=FIX     , $
 SEGMENT=HOLD1, SEGTYPE=S1, $
 FIELDNAME=COUNTRY, ALIAS=E01, USAGE=A10, ACTUAL=A12,
 MISSING=ON, $
 FIELDNAME=RETAIL_COST, ALIAS=E02, USAGE=D7, ACTUAL=D08,
 MISSING=ON, $
 FIELDNAME=DEALER_COST, ALIAS=E03, USAGE=D7, ACTUAL=D08,
 MISSING=ON, $
 FIELDNAME=CAR, ALIAS=E04, USAGE=A16, ACTUAL=A16,
 MISSING=ON, $
 FIELDNAME=RETAIL_COST, ALIAS=E05, USAGE=D7, ACTUAL=D08,
 MISSING=ON, $
 FIELDNAME=DEALER_COST, ALIAS=E06, USAGE=D7, ACTUAL=D08,
 MISSING=ON, $

Platform and release as per current client details in my signature!

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
November 16, 2007, 02:39 AM
Tony A
Btw, windoze platform accepts !TYPE or ! TYPE

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10