by Richard A. DeVeneziaSend Feedback
These Windows API interfaces have not been peer tested for quality assurance and are presented as-is. Use at your own risk.
Send questions
or feedback to Richard A. DeVenezia
SAS DATA Step and SAS/AF SCL programs use the ModuleN() and ModuleC() functions to call routines that reside in external dynamic link libraries (.dll) Each routine you call must be invoked with the proper number of arguments and types (known as attribute information). This information is stored in a text file that is referenced by the fileref SASCBTBL.
I don't know what SASCBTBL stands for exactly, I think of it as "SAS Control Block TaBLe." However, according to a birdie:
It's actually an abbreviation for SAS CoBol Table. Why that? The original version of MODULE was called COBOLINT. It was intended as a COBOL interface for sites that wanted to call COBOL routines from within the DATA step.
New samples: MD5 | ||
---|---|---|
rad4sas.dll - Richard A. DeVenezia | ||
rad4sas.dll | Place rad4sas.dll in a folder in your system %PATH%. | |
rad4sas.c | rad4sas.dll was compiled by MS Visual C++ 5.0 |
|
Routine | Example | Purpose |
DisableProcessWindows- SystemMenuCloseItem |
sample | Disable close item in SAS session window system menu, also greys the X close window icon. Principal design inspired by discussion in newsgroup comp.soft-sys.sas (SAS-L) regarding how to prevent SAS session exits that would cause a SAS/AF application (typically invoked using SAS -initcmd command line option) to end without running it's TERM section. |
GetProcessChildWindows | sample | Return into a SAS data step temporary array a list of Win32 window handles of a SAS session's process owned top-level windows and their child windows. Sample includes: GetWindowTextA, GetMenu, GetSubMenu and GetMenuItemInfoA |
user32.dll - Windows API | ||
Routine | Example | Purpose |
MessageBoxA | sample | User dialog |
MessageBeep | Play a sound | |
FindWindow | sample | Get hWnd of a window |
GetSytemMenu | sample | Get hMenu of a window |
RemoveMenu | sample | Manipulate a windows menu |
comdlg32.dll - Windows API | ||
Routine | Example | Purpose |
GetOpenFileNameA | sample | Dialog for selecting multiple files |
kernel32.dll - Windows API | ||
Routine | Example | Purpose |
GetCommandLineA | sample | How was SAS started ? |
GetCurrentProcessId | sample | What is the SAS session process id ? |
CopyFileA | Copy a file | |
MoveFileA | Rename or move a file | |
DeleteFileA | sample | Delete a file |
GetFileAttributesA SetFileAttributesA |
sample | Get or Set file attributes |
GetDiskFreeSpaceA | Disk information | |
RemoveDirectoryA | Delete a folder | |
CreateDirectoryA | Create a folder | |
GetCurrentDirectoryA | Get current directory | |
WinExec | sample | Run another program |
GlobalMemoryStatus | ||
GlobalAlloc | ||
GlobalLock | ||
GlobalUnlock | ||
GlobalFree | ||
FindFirstFileA | sample | |
FindNextFileA | ||
FindClose | ||
FileTimeToLocalFileTime | ||
FileTimeToSystemTime | ||
RtlFillMemory | ||
GetCommandLineA GetBinaryTypeA GetCompressedFileSizeA GetFileAttributesA GetFileAttributesExA GetFileTimeA FileTimeToLocalFileTime FileTimeToSystemTime CreateFileA GetFileSize CloseHandle |
sample | These file management routines obtain information about a specific file |
advapi32.dll - Windows API | ||
Routine | Example | Purpose |
RegOpenKeyEx RegCloseKey RegQueryValueEx RegSetValueEx RegQueryInfoKey RegEnumValue |
sample 1 sample 2 |
Manipulate windows registry. Sample 1 changes registry keys so that the next Enhanced Editor window that opens has a different font.Sample 2 exposes information Microsoft stores under UserAssist registry key. |
GetUserNameA | sample | Determine name of logged in user |
GetFileSecurityA GetSecurityDescriptorOwner LookupAccountSidA |
sample | Determine a file's owner |
cryptdll.dll - Windows API | ||
Routine | Example | Purpose |
MD5Init MD5Update MD5Final |
sample | One way encrypt data values. Useful for password files and blinding personal aspects of data that is distributed for study. |
wsock32.dll - Windows API | ||
WSAStartup WSACleanup gethostname gethostbyname |
sample | |
odbc32.dll - Windows API | ||
SQLAllocHandle SQLFreeHandle SQLSetEnvAttr SQLDataSources SQLGetDiagRec |
sample | Get list of ODBC Data Source Names, SYSTEM or USER or both |
Clipboard Example | ||
user32.dll FindWindow RegisterClipboardFormat OpenClipboard EmptyClipboard CloseClipboard SetClipboardData kernel32.dll GlobalAlloc GlobalLock GlobalUnlock RtlMoveMemory |
sample | Use DATA Step to programmatically place text, html or rtf in the Windows clipboard so that it may be pasted elsewhere (manually or dde). |
These Windows API interfaces have not been peer tested for quality assurance and are presented as-is. Use at your own risk.
Send questions
or feedback to Richard A. DeVenezia
Can't find Windows functions for direct file
management ?
Last I looked it was at this awkward drill:
MSDN
Library
Windows Development
» Windows Base Services
» Files and
I/O
» SDK Documentation
»
Storage
» Storage Reference
» File Management
Reference
» File Management Functions