SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

How do I reference the INPUT tables joined in a Generated Transformation

Accepted Solution Solved
Reply
Contributor
Posts: 38
Accepted Solution

How do I reference the INPUT tables joined in a Generated Transformation

I want to create a GT that can take two (or more) input tables. In my previous GT I used the following code to reference the last connnected table, but that was the only one connected to GT:

data OUTPUTDATA;

set &SYSLAST;

....

and I could reference the &SYSLAST in a 'merge' statement.

Now I want to merge records from two input tables.

I want to resolve this before l post further details of the work that I want to complete.

Any help is appreciated.


Accepted Solutions
Solution
‎11-01-2011 10:36 AM
Super User
Super User
Posts: 7,050

How do I reference the INPUT tables joined in a Generated Transformation

The suggestion was that the names would be in MACRO variables.

Try changing _INPUT2 to &_INPUT2 in your code.

Is there some way to see the code and/or log from the generated transform to see if it does reference macro variables?

View solution in original post


All Replies
Super Contributor
Posts: 356

How do I reference the INPUT tables joined in a Generated Transformation

Isn't there _input Macro vars? ie _Input1 is the first input table etc.

Barry

Contributor
Posts: 38

How do I reference the INPUT tables joined in a Generated Transformation

Posted in reply to twocanbazza

That is correct.

Following is my code in the GT:

--------------------- code ---------------------------------------------

data CODES;

proc sql noprint;

     select CONFIGID, PARAMETER_2, RESULT_VAL_CODE as SUBTYPE from _INPUT2

      where CONFIGID='xxx1' and PARAMETER_2='xxx2';

     %put CONFIGID PARAMETER_2 SUBTYPE;

quit;

%put CONFIGID PARAMETER_2 SUBTYPE;

run;

--------------------- code ---------------------------------------------

But when I reference these I get an error message:

--------------------- log ---------------------------------------------

174        proc sql noprint;

175             select CONFIGID, PARAMETER_2, RESULT_VAL_CODE as SUBTYPE from _INPUT2

176              where CONFIGID='xxx1' and PARAMETER_2='xxx2';

ERROR: File WORK._INPUT2.DATA does not exist.

NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.

177             %put CONFIGID PARAMETER_2 SUBTYPE;

CONFIGID PARAMETER_2 SUBTYPE

178       

179        quit;

NOTE: The SAS System stopped processing this step because of errors.

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

--------------------- log ---------------------------------------------

I think there is more to it to reference the inout tables.

Solution
‎11-01-2011 10:36 AM
Super User
Super User
Posts: 7,050

How do I reference the INPUT tables joined in a Generated Transformation

The suggestion was that the names would be in MACRO variables.

Try changing _INPUT2 to &_INPUT2 in your code.

Is there some way to see the code and/or log from the generated transform to see if it does reference macro variables?

Contributor
Posts: 38

How do I reference the INPUT tables joined in a Generated Transformation

Thanks Tom. That helped. So that means I do not need to use the

set &SYSLAST;

but a direct reference is OK.

Also, the &_INPUT# usage depnds on the order of input table joins.

Thanks,

Super Contributor
Posts: 356

How do I reference the INPUT tables joined in a Generated Transformation

hmmmm, I was hoping for the Correct answer points Smiley Wink

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 291 views
  • 0 likes
  • 3 in conversation