DataObject.GetServerDataSetName

Prototypes

String GetServerDataSetName()

Return Value

The return value is a reference to a String object containing the name of the DataObject in a form that is compatible with the naming rules for SAS library members.

Remarks

This method returns the name of the DataObject in a form that is compatible with the naming rules for SAS library members.

When an IMLPlus program needs to copy information from a DataObject to a data set in a SAS library, the program must provide a name for the data set. The program could use a fixed name for the data set, such as MYDATA, but it is often preferable to use a name that resembles the actual name of the DataObject. Every DataObject has a name that conforms to the rules for filenames in Microsoft Windows. Because those rules permit names that are not valid for SAS library members, the program cannot use the Windows filename of the DataObject to create a new data set within a SAS library. Instead, the program should use the name returned by the method GetServerDataSetName. This method applies the following transformations to the Windows filename to convert it to a form that is compatible with a SAS library:

  1. The filename extension is removed.
  2. Blanks are removed.
  3. Characters that are not allowed in SAS library member names are converted to '_'. SAS library member names can only contain the characters 'A'-'Z', 'a'-'z', '0'-'9', and '_'.
  4. If the first character is a digit, the name is prefixed with '_'.
  5. If the name is a reserved word, the name is prefixed with '_'. The following names are reserved words: _DATA_, _LAST_, and _NULL_.
  6. If the name is longer than 32 characters, it is truncated to 32 characters.
  7. If the name is empty, the default name "Data" is used.

The following methods copy information from a DataObject to a data set in a SAS library:

WriteToOtherServerDataSet

WriteToServerDataSet

WriteVarsToOtherServerDataSet

WriteVarsToServerDataSet

Example
declare DataObject dobj;
dobj = DataObject.Create( "1 Really Great! Name" );
name = dobj.GetServerDataSetName();
print name;