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     [SOLVED] Setting an Amper variable from a fex.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Setting an Amper variable from a fex.
 Login/Join
 
Gold member
posted
After much searching, I am stumped. I am trying to run a fex and then take the ouput from that fex to set an amper variable to be used elsewhere in a larger procedure. This would be like a subroutine. My code is as follows:
-TOP
-SET &ECHO=ALL;
-? &
TABLE FILE RORCRHR
SUM
   	 'RORCRHR.RORCRHR.RORCRHR_AIDY_CODE' AS 'AIDY'
BY 'RORCRHR.RORCRHR.RORCRHR_TERM_CODE' AS 'Term' NOPRINT
WHERE RORCRHR.RORCRHR.RORCRHR_TERM_CODE EQ '&TERM';
ON TABLE SET HOLDFORMAT ALPHA
-*ON TABLE PCHOLD FORMAT HTML
ON TABLE HOLD AS HOLDAIDY
END
-RUN
-READ HOLDAIDY &AIDY.A4. CLOSE
-IF &IORETURN NE 0 GOTO ENDIT;
-TYPE &AIDY
-ENDIT;  


If I run just the fex out to HTML, I get a valid value. Useing -TYPE, is gives me zeros.
Is this possible? What am I doing wrong?

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


Prod: WF 7.7.05, BID, MRE, 7.7.06M Server, Windows 2008, RedHat, Oracle 11gR1, MS Office 2010
Test: I wish we had one!
 
Posts: 75 | Location: Wichita, KS | Registered: February 19, 2008Report This Post
Gold member
posted Hide Post
Try this:

 SET HOLDLIST = PRINTONLY
-SET &IORETURN = 0;

TABLE FILE RORCRHR
SUM
     'RORCRHR.RORCRHR.RORCRHR_AIDY_CODE' AS 'AIDY'
BY 'RORCRHR.RORCRHR.RORCRHR_TERM_CODE' AS 'Term' NOPRINT
WHERE RORCRHR.RORCRHR.RORCRHR_TERM_CODE EQ '&TERM';
ON TABLE HOLD AS HOLDAIDY FORMAT ALPHA
END
-RUN

-REPEAT ENDIT WHILE (&IORETURN EQ 0)
-READ HOLDAIDY NOCLOSE &AIDY.A4.
-TYPE &AIDY
-ENDIT
-CLOSE HOLDAIDY
 


WF 7.6.10, Windows, PDF, Excel
 
Posts: 75 | Location: Dallas, TX | Registered: February 12, 2004Report This Post
Gold member
posted Hide Post
Thanks for the reply Mary. I keep getting Error at or Near line 14....
FOC295 A value is missing for &AIDY.

I do get 1 record from the fex which is what is expected.


Prod: WF 7.7.05, BID, MRE, 7.7.06M Server, Windows 2008, RedHat, Oracle 11gR1, MS Office 2010
Test: I wish we had one!
 
Posts: 75 | Location: Wichita, KS | Registered: February 19, 2008Report This Post
Expert
posted Hide Post
Here is another way.

SET HOLDLIST = PRINTONLY

TABLE FILE RORCRHR
SUM
COMPUTE CNTR/I9 = LAST CNTR + 1 ; NOPRINT
COMPUTE CODE/A?? = '-SET &AIDY' || LJUST(FTOA(CNTR,'(F9)','A9'),'A9') || '=''' || 'RORCRHR.RORCRHR.RORCRHR_AIDY_CODE' || ''';' ;
BY 'RORCRHR.RORCRHR.RORCRHR_TERM_CODE' AS 'Term' NOPRINT
WHERE RORCRHR.RORCRHR.RORCRHR_TERM_CODE EQ '&TERM';
ON TABLE HOLD AS HOLDAIDY FORMAT ALPHA
END
-RUN
-SET &AIDYCNT = &LINES ;
-INCLUDE HOLDAIDY
-? &AIDY

-REPEAT AIDYLOOP FOR &CNTR FROM 1 TO &AIDYCNT
-TYPE &AIDY.&CNTR
-AIDYLOOP



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
Gold member
posted Hide Post
Thank you Mary and Waz. I used tidbits from both and a little more digging and came up with the following:
-TOP
-*SET &ECHO=ALL;
-*? &
DEFINE FILE RORCRHR
AIDY1/A4V=RORCRHR.RORCRHR.RORCRHR_AIDY_CODE;
END
TABLE FILE RORCRHR
BY 'RORCRHR.RORCRHR.RORCRHR_TERM_CODE' NOPRINT
BY 'RORCRHR.RORCRHR.AIDY1'
WHERE RORCRHR.RORCRHR.RORCRHR_TERM_CODE EQ '&TERM';
ON TABLE HOLD AS HOLDAIDY FORMAT ALPHA
END
-RUN
-READ HOLDAIDY,&AIDY1.A10

-IF &IORETURN NE 0 GOTO ENDIT;

-SET &AIDY = EDIT(&AIDY1,'$$$$$$9999');

-ENDIT;
END  


This -INCLUDE takes the parm &TERM and builds an amper variable &AIDY to be used in logic following.
Thanks again. Your help is always valuable.
Paul


Prod: WF 7.7.05, BID, MRE, 7.7.06M Server, Windows 2008, RedHat, Oracle 11gR1, MS Office 2010
Test: I wish we had one!
 
Posts: 75 | Location: Wichita, KS | Registered: February 19, 2008Report This Post
Expert
posted Hide Post
Be wary of using -READ HOLDAIDY,&AIDY1.A10

Two things.

1. The comma in the line tells FOCUS that you are reading comma delimited line of info.
2. You should always have the ending period (.A10.)


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
Gold member
posted Hide Post
Thank you Waz. My oversite. I still get confused with punctuation in Focus. Your comments are greatly appreciated.


Prod: WF 7.7.05, BID, MRE, 7.7.06M Server, Windows 2008, RedHat, Oracle 11gR1, MS Office 2010
Test: I wish we had one!
 
Posts: 75 | Location: Wichita, KS | Registered: February 19, 2008Report This Post
Expert
posted Hide Post
If you are unsure, check the manual.

Actually I think checking the manual is always a good idea.

You don't want to start up some nasty habits. From my experience they become "standard code" and then get caught out in later releases with code tightening.

Also if the documnented code does not work, then techsupport will have to listen to you.


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     [SOLVED] Setting an Amper variable from a fex.

Copyright © 1996-2020 Information Builders