BookmarkSubscribeRSS Feed
VVDR
Obsidian | Level 7

Hi,

I am using SAS DI and I want to map below sas code into DI transformation. Please help me here. 

Ex:

Data Test1;

   set Test2;

   Set Test3;

keep Var1 var2;

Digita=0;

Digitx=0;

Digity=0;

digitz=Total;

new_digit=0;

/*do unitl*/

do until (digita=digitb);

if digitx=&mcarovar then digitx=49;

digity+1;

digitx+1;

digita+1;

Rec_digit=digita;

Branch_digit=digitx;

output;

end;

run;

 

For now I am using user written transformation.

But curious to know how can we do that in SAS DI. 

Thanks 

 

1 REPLY 1
LinusH
Tourmaline | Level 20

If you wan to to use a SAS supplied transformation instead, it would require you to be able to transform this code to SQL. Not sure what it does, but suspect it would be hard?

 

If this is a program pattern, the second best to do is to create a user Written transformation which you could resuse.

 

Otherwise you are stick to User Written. But by doing so, be sure to use as much of the DI Studio supplied macro variables as possible in your code, such as _input and _output.

Data never sleeps

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

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