Your SAS programs, embedded in web apps and elsewhere

symget('_url') returning missing value

New Contributor
Posts: 4

symget('_url') returning missing value


I'm trying to create a simple HTML front for my stored process and all of the code works fine EXCEPT symget('_url') is returning a missing value. Can anyone tell me why? Here is a sample of my code (with <> changed to {}):

data _null_;
file _webout;

thissrv = symget('_url');
thispgm = symget('_program');

put '{br}';
put '{h1 align="center"}New SAS Report{/h1}';

put '{hr}';

put '{FORM ACTION="' thissrv +(-1) '" method=get}';

put '{input type="hidden" name="_program" value='
thispgm +(-1) '"}';
put '{input type="hidden" name=reqtype value="page1"}';

put '{br}';
put '{p}Please Select a Plan Year:
{select NAME=PlanYear}

put '{input type="SUBMIT" value="Run Report"}';
put '{/form}';

put '{/html}';

Posts: 8,744

Re: symget('_url') returning missing value

Hi...this may be a question for Tech Support, as they can investigate in more detail. _URL may not be available to your stored process, depending on how you're submitting it. According to the explanation at this page

...not all reserved macro variables are available from every client or on every server.

Also, attempting to write your own HTML in a DATA step program may turn out to be a separate problem. This web page:
includes the statement that

If you are writing to _WEBOUT using PUT statements while ODS has _WEBOUT open, when you execute the code the PUT statement data might be out of sequence with the data generated by ODS. This problem occurs because both your code and ODS are opening the same fileref at the same time. For example, the following code might not always work as expected:

Refer to the above web site for more details and a workaround. Or, contact Tech Support for help with your specific problem.

New Contributor
Posts: 4

Re: symget('_url') returning missing value

Thanks for the suggestions Cynthia, I looked at the two links and they don't sound like they apply to my situation. I have another stored process that uses the same code and works fine, and the two stored processes are deployed with the exact same options.

Also, I do not have any additional ODS statements that are writing to _WEBOUT.

I have submitted this to SAS tech support to see if they have any further suggestions, I'll update this thread if there's a resolution.

Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation