BookmarkSubscribeRSS Feed
DejanPeeski
Calcite | Level 5

I want to create SAS AF application and to use a sas macro in the scl file.  Look at the attached catalog .I want to run the sas macro from the frame Hotdeck when i will click the next button.

Thanks

3 REPLIES 3
LinusH
Tourmaline | Level 20

I don't have SAS/AF at my fingertips right now, so I can't see how you intend to use the macro. Perhaps you could describe it in the post instead?

Generally speaking, crating methods is a more integrated way to do it in a SCL enviroenment.

Data never sleeps
DejanPeeski
Calcite | Level 5

I use SAS Base most of my time and i create a macro for doing some imputation in a data set. As a next step i was trying to develop some basic application that will run and execute the macro. This application will be for other persons who are not so familiar with SAS but have SAS on their computer. I create a catalog and in the catalog i have two frames . The first is just a basic frame with two push buttons (close and entry).

the scl for the first frame is:

INIT:

return;

entry:

call display('Hotdeck.frame');

return;

The second frame named"Hotdeck" consists several buttons for choosing the input library, input data set, output library, output data set , four list box controls for choosing the variables that should be imputed, than variables for sorting , variables for imputation classes and id variable, 3 radio box controls and one text entry.

the scl for the second frame that i create is this:

dcl char(200)  metimpu str stra strb, char(20) outdata1 , list varimpu varimpua varimpub;

INIT:

rc=preview('copy','test.test.donor.source');

submit continue; 

endsubmit;

return;

selectinputlibrary:

libre=liblist('^sashelp ','*','choose a libref');

lib_in_sel.label=libre;

return;

select2:

dso=dirlist('','data',1,'y','','');  

selectedData.label=dso;

return;

selectLib:

libres=liblist('^sashelp ','*','choose a libref'); 

lib_out_sel.label=libres; 

return;

NEXT:

str=' ';

varimpu=selimpu.selectedItems;

do k = 1 to listlen(varimpu);

str = str !!' '!! getitemc(varimpu,k);

end;

stra=' ';

varimpua=SelImpClass.selectedItems;

do j = 1 to listlen(varimpua);

stra = str !!' '!! getitemc(varimpua,j);

end;

strb=' ';

varimpub=SelSortVar.selectedItems;

do i = 1 to listlen(varimpub);

strb = str !!' '!! getitemc(varimpub,i);

end;

metimpu=radio_met.selectedItem;

outdata1=compress(Textentry1.text);

submit continue;

%Hotdeck (MISSVAR=&str,CLASS=&stra,SORTVAR=&strb,DIRECTN=&metimpu,MVALUE=&outdata1,IMPALL=0);

endsubmit;

return;

In the Hotdeck.source i put the macro .

Amir
PROC Star

Hi,

Is the following of help:

SAS(R) Component Language 9.2: Reference

and the following mentions an entry type of "macro":

SAS/IntrNet(R) 9.2: Application Dispatcher

Regards,

Amir.

Message was edited by: Amir Malik - Strike through the second suggested link as this is for another product.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 927 views
  • 0 likes
  • 3 in conversation