Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Passing Variables from a procedure to a data flow
Go
New
Search
Notify
Tools
Reply
  
Passing Variables from a procedure to a data flow
 Login/Join
 
Member
posted
I created a simple data flow called df_mytest_fm_to_sql to move data from source to target. I am able to execute this flow without any problem. I added the following filter to select columns node in the data flow.
T1.FirstName = &&TESTVAR

I created a simple procedure called setdbvar and it has the following code
EX CMASAP REQ_NAME=df_mytest_fm_to_sql, CM_ASYNC=OFF, PARMS="&&TESTVAR=Jim";

When I execute the procedure, I am getting an error which says - (FOC295) A VALUE IS MISSING FOR: &&TESTVAR

My goal of this test is to pass the value "Jim" to the &&TESTVAR variable and I would like the procedure to run the data flow using CMASAP.

Any help here is appreciated.


iSM 616
iDM 7705
iDQC 802
WF 77
Windows 2008 Server
 
Posts: 29 | Registered: May 01, 2007Reply With QuoteReport This Post
Virtuoso
posted Hide Post
AK,
You have a procedure (focexec) called 'setdbvar'.
In this procedure you have the command EX CMASAP. CMASAP is also a focexec.
If you write:
  
-SET &&TESTVAR='Jimm';

before your EX CMASAP it will receive the value of this global parameter.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1936 | Location: Tel Aviv, Israel | Registered: March 23, 2006Reply With QuoteReport This Post
Member
posted Hide Post
Daniel, thanks for replying back.

I did try this option -
-SET &&MYVAR2 = 'Jim';
EX CMASAP REQ_NAME=df_mytest_fm_to_sql, CM_ASYNC=OFF, PARMS="&&TESTVAR=&&MYVAR2";

and I am getting the same error.

The filter in the iDM data flow is
T1.FirstName = &&TESTVAR


iSM 616
iDM 7705
iDQC 802
WF 77
Windows 2008 Server
 
Posts: 29 | Registered: May 01, 2007Reply With QuoteReport This Post
Virtuoso
posted Hide Post
From the manual,

Syntax: How to Supply a Variable Value With Another Procedure
EX[EC] procedure name=value where:

procedure

Is the name of the procedure that will contain the name/value values.


name

Is the variable name.


value

Is the value you are giving to the variable.


EX SLRPT CITY=STAMFORD, CODE1=B10, CODE2=B20

So you should be able to
EX CMASAP REQ_NAME=df_mytest_fm_to_sql, CM_ASYNC=OFF, TESTVAR=Jim


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Try this:

-DEFAULT &&TESTVAR='&&TESTVAR'

EX CMASAP REQ_NAME=df_mytest_fm_to_sql, CM_ASYNC=OFF, PARMS="&&TESTVAR=Jim";


Data Migrator 5.3, 7.1, 7.6
WebFOCUS 7.1, 7.6, 7.7
SQL Server, Oracle, DB2
Windows
 
Posts: 126 | Registered: January 18, 2007Reply With QuoteReport This Post
Virtuoso
posted Hide Post
I don't think you can set -DEFAULT values in this way. It still has to get the value of &&TESTVAR from somewhere.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Reply With QuoteReport This Post
Platinum Member
posted Hide Post
I've done this before and it works for me. I copied this straight from a flow I have running right now:

-DEFAULT &&LOAD_YYM='&&LOAD_YYM'

-BUILD_CSV

EX CMASAP REQ_NAME=PF_IRF_CLAIM_CSV_BUILD, CM_ASYNC=OFF, PARMS="&&LOAD_YYM=&LOAD_YYM"
-RUN


Data Migrator 5.3, 7.1, 7.6
WebFOCUS 7.1, 7.6, 7.7
SQL Server, Oracle, DB2
Windows
 
Posts: 126 | Registered: January 18, 2007Reply With QuoteReport This Post
Virtuoso
posted Hide Post
You've got two different variables in there - &&LOAD_YYM and &LOAD_YYM. One is global, the other is local. In your code, where would it get the value for &LOAD_YYM?


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Reply With QuoteReport This Post
Expert
posted Hide Post
The other way to pass the amper variable is to use the pipe character.

EX CMASAP REQ_NAME=df_mytest_fm_to_sql, CM_ASYNC=OFF, PARMS="&|&|TESTVAR=Jim";


This stops the test for the variable and removes the pipes when it is evalulated.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6136 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Platinum Member
posted Hide Post
The value for &LOAD_YYM is determined higher up in the procedure. I didn't include all that code because I didn't think it was relevant to what AK was looking for. When the process executes, it comes out looking something like this:

-DEFAULT &&LOAD_YYM='&&LOAD_YYM'

-BUILD_CSV

EX CMASAP REQ_NAME=PF_IRF_CLAIM_CSV_BUILD, CM_ASYNC=OFF, PARMS="&&LOAD_YYM=200710"


Data Migrator 5.3, 7.1, 7.6
WebFOCUS 7.1, 7.6, 7.7
SQL Server, Oracle, DB2
Windows
 
Posts: 126 | Registered: January 18, 2007Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Passing Variables from a procedure to a data flow

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.