BookmarkSubscribeRSS Feed
Kris18
Calcite | Level 5

Hi everyone!

 

I have a few questions in regards to a few things. mainly trying to figure out a few things for a class I am currently taking. So, going to post some of the questions:

 

What are the functions of the '*' and the ' /* */' combination? 

-Basically, they are mainly used for creating comments correct? 

 

With exporting in SAS, what happens if the file type does not match the dbms? And what is a way to avoid this in general? Or an ingenious way to avoid this?

 

Say I want to import an EXCEL sheet with the following code:

 

PROC IMPORT OUT= AGR.myfirstdata
DATAFILE= "&path.&XL_in"
DBMS=xls REPLACE;
RANGE="Data";*use either range or sheet but not both;
*Sheet=CIR_02;
GETNAMES=YES;
RUN;
proc print data=AGR.myfirstdata;run;

 

What happens if I put all the lines into one sheet? Nothing happens?  Do I get a premature termination and an error? SAS terminates and a force restart? 

 

3 REPLIES 3
LinusH
Tourmaline | Level 20
Hi,
If you are taking a class I think you should direct your immediate question to your tutor.
That said:
/* */ is programming languages standard concept of holding comments.

For the Excel export, why don't you try and see for yourself?
Data never sleeps
Kris18
Calcite | Level 5

I have tried it for myself. I just want to make sure I am on the right path. Also, discussed with my tutor, but again.. want to double check on everything before I steam ahead. 

Reeza
Super User

@Kris18 wrote:

With exporting in SAS, what happens if the file type does not match the dbms? And what is a way to avoid this in general? Or an ingenious way to avoid this?

Say I want to import an EXCEL sheet with the following code:

PROC IMPORT OUT= AGR.myfirstdata
DATAFILE= "&path.&XL_in"
DBMS=xls REPLACE;
RANGE="Data";*use either range or sheet but not both;
*Sheet=CIR_02;
GETNAMES=YES;
RUN;
proc print data=AGR.myfirstdata;run;

 

SAS isn't going to care about the file extension, it writes the file with the DBMS specified. 

I'm assuming by 'file type' you mean extension? You can change that to whatever you want, it may or may not change the underlying data but that has nothing to do with SAS and more to do with how the file system and other applications work. 

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 668 views
  • 0 likes
  • 3 in conversation