Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Retrieve fieldnames from Hold File with Across

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Retrieve fieldnames from Hold File with Across
 Login/Join
 
Silver Member
posted
I have a hold file that looks like this:

TABLE FILE HLDOTBOUT
SUM
     NET_OTB
BY CLASS_ID
BY DEPT_DESCR
BY SUBDEPT_DESCR
BY CLASS_DESCR
ACROSS MONTH_ID
ON TABLE SET PAGE-NUM OFF
ON TABLE SET BYDISPLAY ON
ON TABLE HOLD AS HLDOTBGRID FORMAT FOCUS
END


How can I programmatically get the field names of the resulting hold file so I can use a particular field name for the succeeding report? Since the field names are dynamically generated when I use across.

The result for the above code would look like this:
CLASS_ID	DEPT_DESCR	SUBDEPT_DESCR	CLASS_DESCR	NET201105	NET201106	NET201107	NET201108	NET201109	NET201110	NET201111	NET201112
40010001	FURNITURE	LIVING ROOM	SOFA/LOVESEATS	166,542	87,246	12,795	-78,164	-62,953	-37,706	-165,916	-379,959
40010002	FURNITURE	LIVING ROOM	RECLINERS	77,826	54,978	63,778	-111,756	12,180	-4,270	-41,761	-100,858
40010003	FURNITURE	LIVING ROOM	OCCASIONAL SEATING	146,669	-15,217	-70,059	93,218	115,742	227,230	284,037	284,037
40020001	FURNITURE	BARSTOOLS	BARSTOOLS	-239,542	306,490	293,763	243,381	146,812	593,524	918,981	918,981
40030001	FURNITURE	DINING CHAIRS	DINING CHAIRS	169,332	-21,146	-62,972	-102,351	-340,111	-208,737	203,167	228,644
40040001	FURNITURE	DINING TABLES	DINING TABLES	401,314	-225,209	-219,059	76,723	-157,613	-226,160	326,711	326,711
40050001	FURNITURE	BEDROOM	HEADBOARDS	296,170	107,686	39,235	175,674	-400	165,880	207,351	207,351
40050002	FURNITURE	BEDROOM	BED SETS	222,128	-35,258	-96,456	53,672	-49,257	63,736	159,667	159,667
40050003	FURNITURE	BEDROOM	MATTRESSES	-139,464	-41,901	-278,364	-133,512	-149,181	-142,233	-254,468	-233,969
40050004	FURNITURE	BEDROOM	CASE GOODS	151,133	-102,387	-52,690	-11,094	25,205	58,002	72,502	72,502
40050005	FURNITURE	BEDROOM	DAYBEDS	16,099	-57,605	13,588	-18,612	13,588	13,588	16,985	16,985
40060001	FURNITURE	ACCENTS	BEDROOM	14,339	2,793	2,793	3,492	-209,219	2,793	3,492	3,492
40060002	FURNITURE	ACCENTS	KITCHEN	-102,551	297	297	371	297	297	371	371

I would then look at a particular field let's say NET201105 and use this in my condition to generate the succeeding report.

Thanks for your help.

Joel

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


7.6.6
Windows 2003 Server, Sybase IQ, DB2, SQL Server and Oracle Databases
Excel, HTML and PDF
 
Posts: 34 | Registered: February 20, 2008Report This Post
Expert
posted Hide Post
If you want to get the field names created, you can do this by using SYSCOLUM

TABLE FILE SYSCOLUM
PRINT NAME
WHERE TBNAME EQ '{master}'
END


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
You can use Dialogue Manager to read the HOLD master and place the field names in DM numbered variables:

TABLE FILE CAR
 SUM SALES
 BY CAR
 ACROSS COUNTRY
 ON TABLE SET ASNAMES ON
 ON TABLE HOLD AS HOLD1
END
-*
APP FILEDEF HOLDMAST DISK hold1.mas
-RUN
-*
-REPEAT ENDREPEAT1 FOR &I FROM 1 TO 500
-READ HOLDMAST, &TEXTX
-IF &IORETURN NE 0 GOTO QUITREPEAT1 ;
-IF &TEXTX OMITS 'FIELDNAME=' GOTO ENDREPEAT1 ;
-SET &NAMELEN = &TEXTX.LENGTH - 10 ;
-SET &FIELD.&I = GETTOK(&TEXTX,&TEXTX.LENGTH,2,'=',&NAMELEN,'A&NAMELEN.EVAL');
-TYPE &FIELD.&I
-ENDREPEAT1
-QUITREPEAT1


Or...if you are looking for a particular field name (containing 'JAPAN' in this example):

-SET &IORETURN = 0 ;
-*
-REPEAT ENDREPEAT1 WHILE &IORETURN EQ 0 ;
-READ HOLDMAST, &TEXTX
-IF &TEXTX OMITS 'FIELDNAME=' GOTO ENDREPEAT1 ;
-IF &TEXTX OMITS 'JAPAN' GOTO ENDREPEAT1 ;
-SET &NAMELEN = &TEXTX.LENGTH - 10 ;
-SET &FIELDX = GETTOK(&TEXTX,&TEXTX.LENGTH,2,'=',&NAMELEN,'A&NAMELEN.EVAL');
-ENDREPEAT1
-*
-TYPE &FIELDX


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Silver Member
posted Hide Post
Thanks Dan for your input. This really helps.


7.6.6
Windows 2003 Server, Sybase IQ, DB2, SQL Server and Oracle Databases
Excel, HTML and PDF
 
Posts: 34 | Registered: February 20, 2008Report This Post
Platinum Member
posted Hide Post
?FF HLDOTBGRID

is much quicker and simpler.

You'll fine the across columns have unique alias's such as E10 E11 E12 etc.

You can use these in a report.

Or you could edit the HLDOTBGRID.MAS file and change the names to suit your needs.
 
Posts: 140 | Location: Adelaide South Australia | Registered: October 27, 2006Report This Post
Expert
posted Hide Post
OPALTOSH, the issue with ?FF is that is only shows you the columns in the master, but not access them programatically.

Another way to get the column names into a file is CHECK FILE {MASTER} HOLD {AS name}.


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Retrieve fieldnames from Hold File with Across

Copyright © 1996-2020 Information Builders