Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting a VB array
Message
From
30/07/2004 20:49:58
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00929646
Message ID:
00929809
Views:
9
Hi Sergey, good answer but it did not work. I tried that earlier today and it did sound very promising. I am working with SAS tech support so I hope to get this resolved early next week. There is very little information available on the SAS Integrated Object Model (IOM) but I think that the SAS and VFP combo is a very powerful combination.

I am using SAS for Data Mining (running against tables with 700 million rows of data) on a UNIX server and sending summarized results back to VFP via ADO recordsets and then feeding that directly into an Excel PivotTable. I did a sample test and pulled 600K rows from a SAS dataset on UNIX via VFP then pushed the data into Excel in less than a minute. I see a lot of potential in harnessing the power of SAS for analytics and HTML, Excel and other Office products for the output.

The piece I am trying to get working now would allow me to use VFP as a development front end (if I want) to push blocks of SAS code directly to the UNIX processor. I do think it will eventually get resolved - at least I hope so. Only problem is that there are not many persons that use SAS and VFP in this way...

>Tom,
>
>See if COMARRAY() function could help.
>
>>I am trying to convert some VB examples using SAS to VFP using SAS. The example I am using can be found at http://support.sas.com/rnd/itech/doc/dist-obj/winclnt/winvbpro.html under Passing Arrays in IOM Method Calls.
>>
>>
>> Dim obWSMgr As New SASWorkspaceManager.WorkspaceManager
>> Dim obWS As SAS.Workspace
>> Dim errString As String
>> Set obWS = obWSMgr.Workspaces.CreateWorkspaceByServer("My workspace", VisibilityNone, Nothing, "", "", errString)
>>
>> Dim obDS as SAS.DataService
>> Dim vName as variant
>> ' Declare a dynamic array of strings to hold libnames
>> Dim arLibnames() as string
>> Set obDS = obWS.DataService
>> ' pass the dynamic array variable to "ListLibrefs". Upon return,
>> ' the array variable will be filled in with an array of strings
>> ' one element for each libref in the workspace
>> obDS.ListLibrefs arLibnames
>> ' Print each name in the returned array
>>  For Each vName in arLibnames
>>    debug.print vName
>>  Next vName
>>  ' Print the size of the array
>>   debug.print "Number of librefs was: " & Ubound(arLibnames)+1
>>   ObWS.Close
>>
>>
>>Here is my VFP attempt to do the same
>>
>>
>>
>>  *All the above code works in VFP including the oLibRef =   ;
>>    oSAS.DataService.AssignLibref("unixlib","","/mktg01/usg774a","") assignment.
>>
>>  DIMENSION arlibnames[1] AS String
>>  arlibnames = "x"
>>
>>  oSAS.DataService.ListLibrefs( @arLibnames )
>>  For lni = 1 TO ALEN( arlibnames,1)
>>    ? arlibnames[lni]
>>  Next
>>
>>
>>I am getting 'x' back as the value of arlibnames array. Any suggestions? I tried passing the array by value and with a dimension of 10.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform