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

Using a Parameter as a Table Name

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 89
Accepted Solution

Using a Parameter as a Table Name

Forgive me, as I'm new to SAS DI Studio, but I'm looking at a series of jobs that basically contain one 'node' (if that's the right term) which is 'Create Table and Metadata'. This goes out to a SAS DDL program and uses the format contained within to create a new table.

Well, instead of having one of these little 'one node' jobs for each table, I'd like to just have the table name be entered via a prompted parameter. I see that 'Create Table and Metadata' has a parameter tab, and when I create the parameter there, I'm unsure how to get the user to receive the prompt and for the user's input to be passed along as the table name. Do I need to modify the code in the Code tab? if my parameter name is '_parameter' would this be input in the line as follows:

'%let tableName = &_parameter'

Thanks!


Accepted Solutions
Solution
‎05-16-2014 11:51 AM
Frequent Contributor
Posts: 89

Re: Using a Parameter as a Table Name

Sure.

I was able to use the parameters within the option tab by prefacing the parameter name with '&' and ending it with '.'.

For example: &parameter.

View solution in original post


All Replies
Super User
Posts: 5,260

Re: Using a Parameter as a Table Name

Hmm, I'm not sure what you are actually looking at.

If you open a job, and click the node, what does say in the "Node Type" field in the Basic Properties window (default placed at your bottom left)?

EN each of the SAS standard transformations ("Nodes") for table update  there are SAS DDL (or a data step with some attrib statements). Is this what you mean? Or do you have some custom made code?

From another angle, what is the requirement? Since most DI job are target table aware (they will be created if they doesn't exist during execution), this part is more or less for free.

But if you ave a DDL and no meta data registration...who made the DDL?

Data never sleeps
Frequent Contributor
Posts: 89

Re: Using a Parameter as a Table Name

I'm using DI Studio 4.4 and the 'Node Type' is 'Create Table and Metadata'. In the Transformations tab, under the 'Data' subset it's the option between 'Compare Tables' and 'Data Transfer'.

The odd thing is, that even in the help documentation this node isn't listed along with the other Data Transformations. Is it a new type?

Anyway, I've got the parameters now working in the node, but a prompt doesn't come up for the user when I execute the job. The only way it seems to work is if I enter the values in as defaults for the parameters, then use the parameters in the options tab. Again, I'm hoping for a user prompt to pop-up.

CT&M.png

To answer your other question...(Again I'm new to SAS DI Studio), my team makes the DDL via a SAS program, then uses this node to upload the metadata.

Thanks!

EDIT: Maybe I should start a new discussion about Prompts, since the table name as parameter has been resolved. Which folder would the new question be most appropriate in?

Community Manager
Posts: 486

Re: Using a Parameter as a Table Name

Hi jwhite,

Welcome to the Data Management Community! You can start another discussion on the prompts topic the same way you submitted your question on table names. Can you mark LinusH's answer correct on this one (if it solved your initial challenge)? That way other members will know what worked.

Thanks!

Anna

Solution
‎05-16-2014 11:51 AM
Frequent Contributor
Posts: 89

Re: Using a Parameter as a Table Name

Sure.

I was able to use the parameters within the option tab by prefacing the parameter name with '&' and ending it with '.'.

For example: &parameter.

Occasional Contributor
Posts: 5

Re: Using a Parameter as a Table Name

Hi jwhite,

 

Is that a custom component designed by your team? I don't see that component in my DI Studio. Please let me know.

 

Thanks,

☑ This topic is solved.

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

Discussion stats
  • 5 replies
  • 520 views
  • 0 likes
  • 4 in conversation