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

DI - Presetting New Column Data Value

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

DI - Presetting New Column Data Value

Hi there,

I'm a newbie trying to Integration Studio and trying to figure if i am able to add a new column and preset the column value to a specific value based on the data set?

I am importing csv data file through typical file reader and table loader to a destinated output table. I can add an additional column in the final output table with no issue, but trying to find the correct way to set the column value.

2 scenarios :

1. New column 'New' with all data in the column set as 1

2. Based on say a column data 'criteria', if data = 1, 'New' column set as 2, else set as 3.

How should i typically do this in the job flow diagram and execute easily at every run time depending on my files?

Thanks.


Accepted Solutions
Solution
‎06-01-2013 08:37 AM
Respected Advisor
Posts: 4,173

Re: DI - Presetting New Column Data Value

Most transformations allow you to define expressions in the mapping tab. So for example using the table loader if you want a '1' set for a new numeric column simply tipe 1 in the expression.

For 2) map column "a" to the new column, the define an expression accordingly, eg. a case like "when a='25' then 2 else 3".

View solution in original post


All Replies
Solution
‎06-01-2013 08:37 AM
Respected Advisor
Posts: 4,173

Re: DI - Presetting New Column Data Value

Most transformations allow you to define expressions in the mapping tab. So for example using the table loader if you want a '1' set for a new numeric column simply tipe 1 in the expression.

For 2) map column "a" to the new column, the define an expression accordingly, eg. a case like "when a='25' then 2 else 3".

Occasional Contributor
Posts: 9

Re: DI - Presetting New Column Data Value

I have read expression feature in the guide, but to be honest, for a newbie, the expression button is hardly visible for usage in those mapping screens, not to mention some of the mapping scenarios do not allow expression usage also.

Anyway, thanks for the pointer, have got that worked on upon your initial reply!

🔒 This topic is solved and locked.

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

Discussion stats
  • 2 replies
  • 228 views
  • 0 likes
  • 2 in conversation