Tips Talk:Checking for a data set

From sasCommunity
Jump to: navigation, search

sounds good --Nancy 12:46, 18 June 2009 (UTC)

Good tip. I added text, further example, and converted code to SAS lang.--Art Carpenter 22:51, 19 June 2009 (UTC)

  • the see also link points to the main page for the online doc. it should either point to a specific page (e.g., the page for the exist function) that is relevant to this example or it should be removed.
  • the exist function has a second argument that specifies the types of sas data sets that are checked for that should be mentioned
    • the provided code checks if a sas data file exists. it does not check for a sas data set.
    • since Views are valid SAS data sets, the existing code will say a data set does not exist if it is a view

--Don Henderson 21:01, 24 June 2009 (UTC)

Hi Don, thanks for reminding us. I have changed from data sets to data files and highlighted the possible files that can be read by changing the member type option. I have also added a link on the exist function.

Feel free to comment on how I should improve on this.

--Murphy Choy

Tip good - ready to go! --Phil Miller (STATPROF) 17:24, 26 June 2009 (UTC)

Agreed. I did remove the extra see also link to to the online doc. --Don Henderson 19:25, 26 June 2009 (UTC)

I am not sure if having %D_EXIST adds much. What's wrong with below? The exist and %sysfunc are well-known and well-documented. -- chang_y_chung 21:24, 14 January 2011 (UTC)

%if %sysfunc(exist(sashelp.class)) %then ...

I mostly agree Chang. This is mostly a matter of style. --Don Henderson 21:47, 14 January 2011 (UTC)

Hi Chang, I use the macro version to allow for repetitive use in my own environment.

Hi Don, perhaps we should add an additional line to demonstrate that it can work on it's own.

--Murphy Choy From Singapore 01:23, 15 January 2011 (UTC)

Good idea. Maybe you and Chang can collaborate on enhancing the tip. We can then arrange for it to be re-used as an upcoming tip. --Don Henderson 04:00, 15 January 2011 (UTC)