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
SAS Super FREQ

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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