Focal Point
[SOLVED] Passing Variables via EXEC in Version 8

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

July 10, 2015, 12:14 PM
Craig R.
[SOLVED] Passing Variables via EXEC in Version 8
Moving from v7.7.05 to v8.1.04. Is there some new trick in getting variables passed via EXEC? This no longer seems to work:

EXEC SET_CONN DB_CONN=P

That is to say, &DB_CONN appears not to be set to P for use within the SET_CONN procedure. As I said, it works fine in v7.7.05!

Thanks,

Craig

This message has been edited. Last edited by: <Kathryn Henning>,


v8.1.04, 64-bit Windows (Reporting Server), Apache Tomcat (Web/App Server), HTML, PDF, AHTML, Excel outputs
July 12, 2015, 06:11 PM
Waz
It should work.

Do you need to Execute the fex or can you -INCLUDE 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!

July 12, 2015, 08:35 PM
Craig R.
I usually do -INCLUDE procedures, but would prefer to keep this as is, as I EXEC this procedure and a few others in many applications. Hoping to limit my code remediation to those things that truly break going from v7.7 to v8! Will play with it again tomorrow morning...

Craig


v8.1.04, 64-bit Windows (Reporting Server), Apache Tomcat (Web/App Server), HTML, PDF, AHTML, Excel outputs
July 13, 2015, 03:59 AM
Wep5622
What is P?
If it's a string literal, perhaps the solution is to quote it? If it's not, then I'm not familiar with what you're doing and I'd appreciate a pointer Wink

We use EX in WF8.1, also with parameters, and haven't seen the issue you describe. Then again, from the documentation it would appear that EXEC calls a maintain procedure, so perhaps not related to the issue? (-INCLUDE would be in the same boat though)


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
July 13, 2015, 07:46 AM
Tony A
I have a fex named "showvars" with just -? & within it. Trying the following within both WF 8.0.08 and WF 8.1.04 shows the variable P = Something

EX showvars P=Something

 CURRENTLY DEFINED & VARIABLES:
 &&MAS_FULLINFO= N
 &ACCEPTS      =        0
 &APPROOT      = C:\ibi\apps
 &AUTOINDEX    = NO
 &BASEIO       =        0
 &CHNGD        =        0
 &DATE         = 07/13/15
 &DBMSERR      =        0
 &DELTD        =        0
 &DMY          = 130715
 &DMYY         = 13072015
 &DUPLS        =        0
 &ECHO         = OFF
 &FOCFEXNAME   = showvars
 &FOCFOCEXEC   = showvars
 &FOCGRAPHCNT  =        0
 &FOCINCLUDE   =
 &FOCNEXTPAGE  =        0
 &FORMAT       =        0
 &INDEXIO      =        0
 &INPUT        =        0
 &INVALID      =        0
 &LINES        =        0
 &MDY          = 071315
 &MDYY         = 07132015
 &NOMATCH      =        0
 &P            = Something
 &READS        =        0
 &RECORDS      =        0
 &REJECTS      =        0
 &SETFILE      =
 &SORTIO       =        0
 &TOD          = 12.49.25
 &TRANS        =        0
 &YMD          = 150713
 &YYMD         = 20150713

So I would ask what you have within the focexec being executed? Also make sure that it is the one that you think it is by issuing the FOCEXEC extension of the WHENCE command -

WHENCE SET_CONN FOCEXEC

T

This message has been edited. Last edited by: Tony A,



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 
July 13, 2015, 08:13 AM
Craig R.
Ahem (red faced), got back into this first thing this morning, and it looks like it's working fine, after all.

The EXEC version of the "Execute" command hits a procedure on the Reporting Server. From the Help:

"Note: When EXEC is used in Managed Reporting, it is important to note that there is a difference between EX and EXEC. EX statements coded in a procedure are processed by the WebFOCUS Client, which looks for the procedure in the Managed Reporting repository. Procedures that are referenced with an EXEC statement are not processed by the WebFOCUS Client, they are only passed to the WebFOCUS Reporting Server for processing, and these procedures are not looked for in the Managed Reporting repository."

By the way, I wrote that SET_CONN procedure so that I can dynamically connect to our Dev, QA, BA, or Prod database "on the fly" with one set of metadata files. Take a look at "Parameterizing Master and Access File Values Using Variables" in the Help.

Craig


v8.1.04, 64-bit Windows (Reporting Server), Apache Tomcat (Web/App Server), HTML, PDF, AHTML, Excel outputs