01-24-2017 02:36 AM - last edited on 01-24-2017 03:16 AM by LinusH
I'm SAS and other application developer and looking for sas format infromation for developing "data entry form".
I wanna do follow convert.
Applicaiton->[entried data,informat]->dll->application get return value.
 is arguments for call routine.
['1 1 1',yymmdd10.]->dll->[True, '2001-01-01']
['1 1 1',yymdd10.]->dll->[False, missing]
anyone has infromation?
In sashelp.vformat, I found "pathname" and "object name" which shows sas installed directory and dll.
I tried call those dlls but argumens are unknown and faild.=(
Base SAS9.4 TS1M3
Windows 8.1 pro 64bit
01-24-2017 03:20 AM
I'm a bit confused. I have never heard of a requirement containing both SASHELP.VFORMAt and dll...
Can you please elaborate on what you are trying to achieve?
What is the application, and the underlying requirement?
01-24-2017 03:36 AM
Thank you for your reply.
Application is my original application.
I attached sample image.
1.you entry "1 1 1".
2.you click "convert" button.
3."2001-01-01" entered to formated field by automatic.
I wanna auto formatting by other process.
Because I developed by hard coding follow and its inefficiency.
if format="yymmdd10." then
else format="datetime16." then
else format="time5." then
else format="time8." then
else return="format error!"
01-24-2017 03:23 AM
You might want to look at stored processes.
The STP would have two text prompts, and then execute a data step like this:
data _null_; file _webout; result = input("&prompt1",&prompt2); if result ne . then do; put 'True'; put result &prompt2; end; else do; put 'False'; put 'missing'; end; run;
01-24-2017 03:46 AM
Using SAS without using SAS? The interface for the usage of SAS formats is Base SAS, so you have to use it, or find some way to re-engineer it. Besides that this would violate your license agreement, it would be extremely inefficient.
And a properly set up STP will have acceptable response times.
01-24-2017 04:09 AM
I use Delphi to develop interface as substitution of SAS/AF more ease to handle, cheeper.
Eventually entered data is going to converted to sas datasets.
Making formatted data is a part of data checking.
Of course I do not re-engineer sas system files.
I recognize it will violate sas license agreement.
I try STP you suggest. =)
01-24-2017 04:13 AM
I'm not sure formatting dates checks anything. Check for valid dates are built into many languages. If the date is valid then as long as you don't change your process you can convert it for the database.
Formats are lookup tables, whether that's a list, dictionary or other object in a diff language depends on what's available.
01-24-2017 04:08 AM
very thanks for reply and coding.
But I want to implement without run SAS or sas process because of for quick response in my applicaiton.=(
Then why are you asking about this in a SAS forum?
01-24-2017 04:14 AM
01-24-2017 04:41 AM
I would never use somebody else's .dll.
The interface to the dll is internal to their software and might (will!) change without further notice.
The interface for the SAS system is Base SAS, and one should use that.
STPs are documented and supported. The STP infrastructure is the replacement for SAS/AF IMO. We have converted all our AF applications to STPs by now.
01-24-2017 05:00 AM
If you have an application for data entry, regardles of implementation, then that is not a question for this forum which is SAS software specific. I would imagine, that if you try to call bits of the SAS system - assuming you have them at all which isn't clear from your post - might actually invalidate your licence.
What I would suggest is, if you want to write your own application, then use open source formatted data as its output - CSV is simplest, or XML. Then your SAS programs can load that data as part of thier processes. The two systems can then exchange data without needing to interfere with each other. This is the normal method of transfer.
01-24-2017 05:34 AM
Is your data even in SAS?
If not, go somewhere else for 3rd party objects.
If your aim is to update/store data in SAS, STP has already been mentioned. Also, there is a possibility to use OLEDB. Search SAS doc for guidance.
01-24-2017 08:34 PM
SAS FORUM: Data entry, format and dll Probably need 'old text editor' DMS(circa 1980) and full SAS. Does not work in EE, UE, EG or SAS Studio This does not exactly answer your question but may be helpfull see https://listserv.uga.edu/cgi-bin/wa?A2=SAS-L;cea3bbff.1701d This post https://goo.gl/y4Ad0Q https://communities.sas.com/t5/General-SAS-Programming/Data-entry-format-and-dll/m-p/326961 You can also call R (Rshiny?) from SAS/IML This is an oversimplified example look at PMENU and datastep Window and 'proc fsedit' HAVE A DATE =========== 010101 WANT (interactive windows - 010101 <enter> and the converted date will popup) ==== Enter data mmddyy 010101 ------ Converted Date 01JAN2001 --------- FULL SOLUTION ============ %macro datecon; %window choose irow=4 rows=25 #4 @12 "enter data mmddyy" #5 @12 choice 6 attr=underline; ; %display choose; %let date=%sysfunc(putn(%sysfunc(inputn(&choice,mmddyy6)),date9)); %put &=date; %window result irow=4 rows=25 #4 @12 "Converted mmddyy" #5 @12 "&date" attr=underline; %display result;; %mend datecon; %datecon;
01-24-2017 09:01 PM
If you're application is connected to a SAS session (using IOM), then you might be able to use the IOM FormatService.
Sorry, I don't have a ready example. But the FormatService can be used by another app to return a formatted value, given a raw value (or array of them) and a known SAS format.
It's not clear from your question that you are connected via IOM though -- it sounds like you're wanting to use SAS code libraries (DLLs) directly. This is not supported or documented. The only reliable method is to supply your data values into a SAS session (using IOM or another method) and get SAS to format them.