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

Unable to access precode data step variables from the where-statement of an Extract transformation

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 89
Accepted Solution

Unable to access precode data step variables from the where-statement of an Extract transformation

I've created a DI Studio job that requires complex date variables in order to function. All the date variables are calculated in a data step in the precode of an Extract transformation, and show up with correct values in the log. However, I just learned that the precode data step variables aren't accessible from the Extract's where-statement.

What's the best way of making the Extract's precode data step variables available for reference in the Extract's where-statement? I attempted putting %let in front of each variable to no avail, so I guess they're all local to the data step.

Thanks for your time.


Accepted Solutions
Solution
‎11-21-2012 05:30 PM
Super Contributor
Posts: 644

Re: Unable to access precode data step variables from the where-statement of an Extract transformation

call symput in the datastep will create macro variables for you

data somedates ;

     ...

     call symput ('firstdate', put(firstdate, yourformat.)) ;

     /* repeat for each date */

run ;

Depending on your extract transformation requirement you may need dates to be datetime numbers or formatted dates or datetimes.

Richard in Oz

View solution in original post


All Replies
Solution
‎11-21-2012 05:30 PM
Super Contributor
Posts: 644

Re: Unable to access precode data step variables from the where-statement of an Extract transformation

call symput in the datastep will create macro variables for you

data somedates ;

     ...

     call symput ('firstdate', put(firstdate, yourformat.)) ;

     /* repeat for each date */

run ;

Depending on your extract transformation requirement you may need dates to be datetime numbers or formatted dates or datetimes.

Richard in Oz

☑ This topic is SOLVED.

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

Discussion stats
  • 1 reply
  • 174 views
  • 0 likes
  • 2 in conversation