Focal Point
USE & FOR DYNAMIC JOIN - ERRORS - SOLVED

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

November 04, 2010, 03:50 PM
Tomsweb
USE & FOR DYNAMIC JOIN - ERRORS - SOLVED
I have created a dynamic join via dialogue manager.
In this code snippet I am joining these fields:

quote:

AGEGRP IN AGEGRP_99_A TO MULTIPLE AGEGRP IN AGEGRP_00_A

(USING FULLY QUALIFIED NAMES)...

quote:

-SET &JNX = 'JOIN' | ' ' | &CMPL_FN | '.' | &CMPL_FN | '.' | &FNA || ' IN ' | &CMPL_FN ;
-SET &JNY = ' TO MULTIPLE ' | &CMPL_FN_2 | '.' | &CMPL_FN_2 | '.' | &FNA || ' IN ' | &CMPL_FN_2 | ' TAG J0 AS J0' ;

-SET &JNZ = &JNX||&JNY ;


Then, to test it I have tried this:

quote:

-TYPE &JNZ.EVAL
-RUN

CHECK FILE &CMPL_FN (PICT
-RUN

?FF &CMPL_FN
-RUN
-EXIT


I am disappointed to get thei result:

CHECK FILE AGEGRP_99_A (PICT
-RUN

0 NUMBER OF ERRORS= 0
NUMBER OF SEGMENTS= 1 ( REAL= 1 VIRTUAL= 0 )
NUMBER OF FIELDS= 14 INDEXES= 0 FILES= 1
TOTAL LENGTH OF ALL FIELDS= 154
?FF AGEGRP_99_A
-RUN

FILENAME= AGEGRP_99_A
AGEGRP AGEGRP A50
_TYPE_ _TYPE_ D20.2
JUL98 JUL98 D20.2
AUG98 AUG98 D20.2
SEP98 SEP98 D20.2
OCT98 OCT98 D20.2
NOV98 NOV98 D20.2
DEC98 DEC98 D20.2
JAN99 JAN99 D20.2
FEB99 FEB99 D20.2
MAR99 MAR99 D20.2
APR99 APR99 D20.2
MAY99 MAY99 D20.2
JUN99 JUN99 D20.2

-EXIT

I anticipated that I would also see the fields which are contained in the AGEGRP_00_A file, but I did not....

Has anyone else had this problem? Frowner

Thanks!

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


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
November 04, 2010, 03:59 PM
GamP
In stead of -TYPE &JNZ.EVAL do a &JNZ.EVAL (without the -type in front of it).
I do see you building the join command, but I have not seen in your code that you actually execute the join command.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
November 04, 2010, 04:15 PM
Tomsweb
Gamp,

Thank you. I did that and I do see fields from both of the files.

quote:

&JNZ.EVAL
-RUN

?FF &CMPL_FN
-RUN
-EXIT

FILENAME= AGEGRP_99_A
AGEGRP_99_A.AGEGRP AGEGRP_99_A.AGEGRP A50
AGEGRP_99_A._TYPE_ AGEGRP_99_A._TYPE_ D20.2
JUL98 JUL98 D20.2
AUG98 AUG98 D20.2
SEP98 SEP98 D20.2
OCT98 OCT98 D20.2
NOV98 NOV98 D20.2
DEC98 DEC98 D20.2
JAN99 JAN99 D20.2
FEB99 FEB99 D20.2
MAR99 MAR99 D20.2
APR99 APR99 D20.2
MAY99 MAY99 D20.2
JUN99 JUN99 D20.2
AGEGRP_00_A.AGEGRP AGEGRP_00_A.AGEGRP A50
AGEGRP_00_A._TYPE_ AGEGRP_00_A._TYPE_ D20.2
JUL99 JUL99 D20.2
AUG99 AUG99 D20.2
SEP99 SEP99 D20.2
OCT99 OCT99 D20.2
NOV99 NOV99 D20.2
DEC99 DEC99 D20.2
JAN00 JAN00 D20.2
FEB00 FEB00 D20.2
MAR00 MAR00 D20.2
APR00 APR00 D20.2
MAY00 MAY00 D20.2
JUN00 JUN00 D20.2


Now, I must determine how to print with only the sort fields from
the host file as my code below gives me the sort fields from both
files:

TABLE FILE &CMPL_FN
PRINT *
BY AGEGRP
BY _TYPE_ Roll Eyes
END
-RUN
[/QUOTE]

[QUOTE]
AGEGRP _TYPE_ AGEGRP _TYPE_ JUL98 AUG98
0-<1 1.00 0-<1 1.00 25,950.00 25,977.00
[QUOTE]

I can probably do something in a define. Roll Eyes

Thanks!


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
November 04, 2010, 04:25 PM
GamP
quote:
&CMPL_FN

Isn't that the name of your host file?
If so then you could do something similar as what you did for the join.
Something like this:
-SET &PART = 'BODY';
TABLE FILE CAR
PRINT
     &PART.EVAL.BODYTYPE
     &PART.EVAL.SEATS
     &PART.EVAL.DEALER_COST
     &PART.EVAL.RETAIL_COST
     &PART.EVAL.SALES
ON TABLE NOTOTAL
END



GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
November 04, 2010, 04:33 PM
Francis Mariani
Or
-SET &PART = 'BODY';
TABLE FILE CAR
PRINT
     &PART...BODYTYPE
     &PART...SEATS
     &PART...DEALER_COST
     &PART...RETAIL_COST
     &PART...SALES
ON TABLE NOTOTAL
END



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 04, 2010, 04:51 PM
Tomsweb
You mean like this:

quote:

TABLE FILE &CMPL_FN
PRINT
&CMPL_FN.EVAL.JAN99
&CMPL_FN.EVAL.FEB99
&CMPL_FN.EVAL.MAR99
&CMPL_FN.EVAL.APR99
&CMPL_FN.EVAL.MAY99
&CMPL_FN.EVAL.JUN99
&CMPL_FN.EVAL.JUL99
&CMPL_FN.EVAL.AUG99
&CMPL_FN.EVAL.SEP99
&CMPL_FN.EVAL.OCT99
&CMPL_FN.EVAL.NOV99
&CMPL_FN.EVAL.DEC99

BY &CMPL_FN.EVAL.AGEGRP
BY &CMPL_FN.EVAL._TYPE_
END
-RUN
-EXIT


That is very cool if all my fields are from the same file.
If not then I will have to change the value of &CMPL_FN
to retrieve data from the 2nd (xref) file.

I apologize if I did not state what may be obvious...I am
trying to print a calendar year report as the table I am
forced to report from contains only a Fiscal Year of data.

Sorry!

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


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
November 04, 2010, 06:05 PM
Doug
Check the syntax of "CHECK FILE" ... no need for the left paren in 'CHECK FILE AGEGRP_99_A (PICT", is there?...
November 05, 2010, 09:50 AM
Tomsweb
In my post yesterday, I used the CHECK FILE command incorrectly:

quote:

CHECK FILE AGEGRP_99_A (PICT
-RUN

(FOC1517) UNRECOGNIZED COMMAND CHEC
0 NUMBER OF ERRORS= 0
NUMBER OF SEGMENTS= 2 ( REAL= 1 VIRTUAL= 1 )
NUMBER OF FIELDS= 28 INDEXES= 0 FILES= 2
TOTAL LENGTH OF ALL FIELDS= 308
-EXIT



The correct syntax of the command is captioned below:

quote:

CHECK FILE AGEGRP_99_A PICT
-RUN
0 NUMBER OF ERRORS= 0
NUMBER OF SEGMENTS= 2 ( REAL= 1 VIRTUAL= 1 )
NUMBER OF FIELDS= 28 INDEXES= 0 FILES= 2
TOTAL LENGTH OF ALL FIELDS= 308
1SECTION 01
STRUCTURE OF GNTINT FILE AGEGRP_9 ON 11/05/10 AT 09.45.40
AGEGRP_>
01 S0
**************
*AGEGRP **
*_TYPE_ **
*JUL98 **
*AUG98 **
* **
***************
**************
I
I
I
I AGEGRP_>
02 I KM
..............
:AGEGRP ::K
:_TYPE_ ::
:JUL99 ::
:AUG99 ::
: ::
:............::
.............:
JOINED AGEGRP_00_A
-EXIT




Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
November 08, 2010, 10:10 AM
GamP
quote:
If not then I will have to change the value of &CMPL_FN to retrieve data from the 2nd (xref) file.

And that would then be in the &CMPL_FN_2 variable, wouldn't it?


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988