Focal Point
[CLOSED] How to reference columns that have blanks in the name?

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

April 26, 2011, 04:43 PM
Francis Mariani
[CLOSED] How to reference columns that have blanks in the name?
SET ASNAMES=ON
SET HOLDLIST=PRINTONLY
SET HOLDFORMAT=ALPHA
TABLE FILE CAR
SUM
SEATS
ACROSS COUNTRY
ON TABLE HOLD AS H001
END
?FF H001

TABLE FILE H001
PRINT
COMPUTE S1/D5 = SEAENGLAND;
COMPUTE S2/D5 = SEAW GERMANY;
END

The first TABLE produces a HOLD file with these columns:

SEAENGLAND, SEAFRANCE, SEAITALY, SEAJAPAN, SEAW GERMANY.

How does one reference the column with name "SEAW GERMANY" (the 2nd COMPUTE in this example throws an error)? I would rather not use "SEAW" or "E05".

Thanks,

This message has been edited. Last edited by: Francis Mariani,


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
April 26, 2011, 05:54 PM
Waz
You use quotes around the field.

Not sure if its single or double.

I think Developer Studio does this for you, a good place to test it.


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!

April 26, 2011, 05:56 PM
Francis Mariani
The problem with using quotes:

COMPUTE S2/D5 = 'SEAW GERMANY' * 123;
This does not work.


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
April 26, 2011, 06:13 PM
Francis Mariani
Amazingly, I cannot manipulate The Dev Studio GUI to create a report based on a HOLD file! Am I an idiot?


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
April 26, 2011, 07:40 PM
N.Selph
If you create the hold file earlier in the fex in the DEV Studio GUI, you should see it in the list of tables the GUI throws up, in the next piece of its "necklace".


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
April 26, 2011, 08:52 PM
Jim Morrow
You may reference field names with a space as verb objects using single quotes. People use to do this to make for "pretty" column heading.

It also had the effect of driving the support people crazy (also know as me) , when the someone called about error caused by omitted single quotes. The syntax would looked perfect unless you looked at the master. Asking for the master file description often became a "teaching moment" because the caller had never heard of such a thing. They just copied from someone else, and "only made a little change".



TABLE FILE INSURE
SUM
'WRITTEN PREMIUM'
'EARNED PREMIUM'
BY POLICY
END


But in compute / define to the left of an equal sign "=" Focus assumes anything in single quotes is a literal.

My advice get ride of the "blank-it-blank" space.


Jim Morrow
Web Focus 7.6.10 under Windows 2003
MVS 7.3.3



April 27, 2011, 10:04 AM
WF_IL
Hi

Another option to use the internal columns numbering in the report itself

SET ASNAMES=ON
SET HOLDLIST=PRINTONLY
SET HOLDFORMAT=ALPHA
TABLE FILE CAR
SUM
SEATS
ACROSS COUNTRY
ON TABLE HOLD AS H001
END
-RUN



TABLE FILE H001
PRINT
'H001.H001.SEAW GERMANY' NOPRINT
COMPUTE AA/D5=C1 * 5;
COMPUTE DD/D5=SEAENGLAND;

ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
ENDSTYLE
END

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


Yours,
Eran
SRL Products

http://www.srl.co.il

April 27, 2011, 05:58 PM
Waz
Looks like you can only use the fields as a verb or sort field.

Defines or Computes just won't work.

Is this from the ACROSS HOLD only ?, if so, then prep the data prior to holding, converting all apaces to '_'.


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!

April 28, 2011, 09:45 AM
Francis Mariani
I couldn't get a simple fex that reports off a HOLD file to work in the GUI - I have GUI-phobia and the GUI knows it.

Waz, as you suggested, I decided on ensuring there were no blanks in the values that are used in the ACROSS - so all is good.

Thanks,


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