I’m developing a custom task for EG4.1, and in my VB.NET code I’m trying to use the ISASTaskConsumer2.ShowInputDataSelector or ISASTaskConsumer2.ShowDataSelector methods so that the end user can select a data source for input.
Here are the sample codes:
Dim mycookie As String = ""
Dim dsarray As ISASTaskData() = _consumer.ShowInputDataSelector(Me, DataSelectionMode.SingleInput, ServerAccessMode.AnyServer, "", "", "", mycookie)
Dim dnarray As ISASTaskDataName() = _consumer.ShowDataSelector(Me, DataSelectionMode.SingleInput, ServerAccessMode.OneServer, "local", "SASUSER", "SASUSER.", "")
I observe that, after the “Open” screen is displayed:
1. If I select the input data set from an existing SAS Library (“SASUSER.mydataset” for example), an array containing the dada set is properly returned, and I can use it in my program.
2. But, if I try to navigate and select the input data set from the file system (“C:\Myfolder\mydataset.sas7bdat” for example) a null value is returned in the case of _consumer.ShowInputDataSelector, while an array with zero element is returned in the case of _consumer.ShowDataSelector.
So selecting the input data set is OK from a SAS library, but not from the file system.
On the other hand, my end users want to be able to select input data from the file system, not only from a library.
I’m wondering if the problem is caused by settings, by my VB code, or if it is a problem with the ISASTaskConsumer2 class.
I think that you are running into a side effect of a data selection "loophole" in our API. Really, the API doesn't have complete support for selecting a file from the host file system -- only for selecting a data file from a SAS library. However, if you navigate back up from the starting directory to the full server list, then drill back down into the server, you suddenly see the "Files" choice alongside the "Libraries" choice. Oops!
This is what you want, I know, but I think it's a bug in the software that allows you to do this. Then when the selection is made and control returns to your task, the result set is empty, since the API isn't meant to handle this case.
We already have a defect tracked internally to address this in our next version.