BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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?
6 REPLIES 6
Patrick
Opal | Level 21
Have a look at the SAS functions nvalid() and notname()
deleted_user
Not applicable
Hello,

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

Thanks.
Patrick
Opal | Level 21
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
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.
deleted_user
Not applicable
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.
ChrisHemedinger
Community Manager
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
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 6 replies
  • 971 views
  • 0 likes
  • 4 in conversation