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-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

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
  • 680 views
  • 0 likes
  • 2 in conversation