hi,
I'm fully new to SAS, trying to automate like this, but i'm not able to download SEG4AssemblyResolver.c s (2.9 K) file can u help please. Getting "Error An general error occurred while processing your request."
I have a couple of .NET automation examples out on the support site. These are meant for EG 4.2 and Visual Studio 2008, but I'll be creating new ones soon in preparation for SAS Global Forum presentation.
Chris
Hi Chris@SAS,
Happy thanks for ur reply and help. Its Working fine.
I have one more doubt!!! Is it possible to find the Variable format datatype name like 'Date','DateTime','Time',etc... in SAS7bdat extension files?
Mathan,
Apologies for the delayed reply.
The logic to determine the "type" is done by classifying the format of the variable. As you might know, SAS variables are one of two types: numeric or character. Depending on the SAS format applied to a numeric variable, we can guess its probable role. For example, a numeric variable with MMDDYY6. format is a Date value.
We have some helper classes in the SAS.Tasks.Toolkit assembly that provide this logic for use in custom tasks, but I'm not aware of any "loose" C# code lying around that does the work.
Chris
Hi Chris,
Thanks for your reply... I need one more help!!!
After long R&D I got the required output by the following code.
CODE :
ods xml file="C:\Users\sas\Desktop\text2.xml";
proc contents data='C:\\Users\\sas\\Desktop\\SAS\\cal_sample.sas7bdat' out=contents DETAILS;
run;
ods _all_ close;
In this 'cal_sample.sas7bdat' file its variable name length is of max 8 characters only, so i got the expected test2.XML as output and i proceessed it to get my output.
But for some sas7bdat files which consists of more than 8 characters as its variable name, in this case alone i'm not getting the XML that is required.
Can u help with any other code that can help me with dis pls..
Instead of using PROC CONTENTS, you can try something like this:
libname data "C:\Users\sas\Desktop\SAS"; /* table level data */ PROC SQL; SELECT t1.memname, t1.nobs FORMAT=comma15., t1.filesize FORMAT=comma20., t1.nvar, t1.num_character, t1.num_numeric FROM SASHELP.VTABLE t1 WHERE t1.libname = 'DATA'; QUIT; /* report on columns in each table */ PROC SQL; SELECT t1.memname, t1.name, t1.type, t1.format, t1.informat FROM SASHELP.VCOLUMN t1 WHERE t1.libname = 'DATA' and t1.memtype='DATA'; QUIT;
I am having the same issue with SAS 4.3, see below: Will you process handle that, if so I may need a little help setting it correctly.
ERROR: SAS Process Failed with below exception:
System.TypeInitializationException: The type initializer for 'SAS.EG.Scripting.Application' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=be58efc3b934219b' or one of its dependencies. The system cannot find the file specified.
File name: 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=be58efc3b934219b'
at SAS.EG.Scripting.Application..cctor()
Yes, you need to use the AssemblyResolver approach that I posted about earlier.
I'm presenting this as part of an larger automation topic at SAS Global Forum this year. I will have a more complete code example available very soon.
Chris
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.