Using global variables in SAS Submit statementIs it possible to use a global variable while submitting to SAS? I wanted to get user input through a dialogue box and use those inputs to get data from a server with SAS data, something like this:
New Window( "GET DATA",
<V List Box(
Text Box("Enter YRQ"),
YRQ = Number Edit Box( 101 ),
Button Box( "OK"),
Button Box( "Cancel")
));
dyrq = yrq << get; <-- This is what I want to pass to SAS
sasconn = sas connect ("research", 5821);
sasconn << SAS Submit ("
%let yrq = ::dyrq <-- here's where I want to read the global in.
");
Is this possible? Or alternately, is there another way to do this (Note - I'm actually collecting other JSL relevent input in the modal box as well)
Message was edited by: LPazRe: Using global variables in SAS Submit statement<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />MattF's technique will work, but the DeclareMacros option does exactly what you're after and should save you a lot of messy code.
Try this:
. . .elided. . .
dyrq = yrq << get;
sasconn = sas connect("research",5821);
sasconn << Submit("data temp; x=&dyrq; proc print; run;", DeclareMacros( dyrq ) );
John
Using global variables in SAS Submit statementSuccess! Thanks so much.
Using global variables in SAS Submit statementHi:
Here is one way - build a string which is then submitted to SAS - I am sure there are others.
Best regards,
-Matt