DATA Step, Macro, Functions and more

how to run macro in scl

Reply
Occasional Contributor
Posts: 7

how to run macro in scl

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

Attachment
Super User
Posts: 5,434

Re: how to run macro in scl

Posted in reply to DejanPeeski

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
Occasional Contributor
Posts: 7

Re: how to run macro in scl

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 .

Super Contributor
Posts: 282

Re: how to run macro in scl

Posted in reply to DejanPeeski

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.

Ask a Question
Discussion stats
  • 3 replies
  • 241 views
  • 0 likes
  • 3 in conversation