Desktop productivity for business analysts and programmers

SAS data set name validation

Reply
N/A
Posts: 0

SAS data set name validation

How can I check, in an EG 4.2 custom task, if a string contains a valid output data set name?

Is there a method provided in the Custom Task API to do that?
Respected Advisor
Posts: 3,840

Re: SAS data set name validation

Have a look at the SAS functions nvalid() and notname()
N/A
Posts: 0

Re: SAS data set name validation

Hello,

I'm building a custom task using VB. I cannot run SAS code from within VB.

Thanks.
Respected Advisor
Posts: 3,840

Re: SAS data set name validation

I see. Sorry, misunderstood your question!

I was browsing through the API docu ( http://support.sas.com/documentation/onlinedoc/guide/customtasks/index.htm ) but couldn't find a method covering what you're looking for.

Couldn't you just implement this by using a Regular Expression? I don't think this should be too difficult. http://www.regular-expressions.info/dotnet.html

May be this paper is also helpful for you:
http://www.lexjansen.com/mwsug/2007/ApplicationDev/A10-2007.pdf

HTH (at least a bit)
Patrick
Super Contributor
Super Contributor
Posts: 3,174

Re: SAS data set name validation

When you say "...contains a valid output data set name". How far do you expect the validity check to go - possibly beyond syntax, meaning to check the particular filesystem environment?

Scott Barry
SBBWorks, Inc.
N/A
Posts: 0

Re: SAS data set name validation

I use a data set selector. I put the selected data set name into a textbox. The text box is editable. The user can modify the name. After the value has been modified, I would like to validate it.

I would like to do the same thing that the summary statistics does in the Results pane for the statistics data set.
Community Manager
Posts: 2,702

Re: SAS data set name validation

Rene,

The idea of using a regular expression is a good one. General format is:

Server:Libname.Member

You can use the classes in SAS.Task.Toolkit (SasServer class, Data.SasLibrary class) to verify that the server and library are valid (that they exist). These are in SAS.Task.Toolkit.dll, which you can use in your task (for EG 4.2).

I wish I had a code example handy, but this should give you something to look at.

Chris
Ask a Question
Discussion stats
  • 6 replies
  • 148 views
  • 0 likes
  • 4 in conversation