Focal Point
Passing Variables from a procedure to a data flow

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

May 05, 2008, 06:14 PM
AK
Passing Variables from a procedure to a data flow
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
May 06, 2008, 04:09 AM
Danny-SRL
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

May 06, 2008, 11:19 AM
AK
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
May 06, 2008, 12:08 PM
Darin Lee
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
May 06, 2008, 01:52 PM
Jessica Bottone
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
May 06, 2008, 04:05 PM
Darin Lee
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
May 06, 2008, 04:20 PM
Jessica Bottone
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
May 06, 2008, 04:26 PM
Darin Lee
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
May 06, 2008, 06:56 PM
Waz
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.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

May 06, 2008, 07:17 PM
Jessica Bottone
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