BookmarkSubscribeRSS Feed
MartinBoland
Fluorite | Level 6

Hi,

 

I have successfully run a 'proc dstrans' to convert data step code to DS2. The only query I have is there are some lines of code which start with a hash (#).

 e.g. 

#_local _P1;

 

Is this a comment? It doesn't seem to do anything so I am assuming it is a comment. Can't find it in DS2 doco though.

 

Thanks,

Martin

 

1 REPLY 1
SASJedi
Ammonite | Level 13

PROC DSTRANS is undocumented because it is only intended for back-end use by other SAS procedures in very specific cases. In SAS 9.4 M6, PROC DSTODS2 is a documented procedure designed to help SAS users translate DATA step code to DS2. I wrote a blog post about this a while back.

 

One limitation is that both the original program file and the output file must reside in the current SAS default directory. In some client-server deployments, you won't have write permission to the SAS default directory. You can work around this by using the base SAS DLGCDIR function to set the default directory to a location where you do have write access.  For example, if you were working in SAS on a Windows server and have write access to the c:\temp directory, you would save your DATA step program to C:\temp, then run code like this to make the translation:

%put %qsysfunc(dlgcdir(c:\temp));
PROC DSTODS2 IN="datastep.sas"
            OUT="ds2program.sas";
RUN;

Hope this helps.

Mark

Check out my Jedi SAS Tricks for SAS Users

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 749 views
  • 1 like
  • 2 in conversation