Desktop productivity for business analysts and programmers

Parameters but no parameters

Frequent Contributor
Posts: 97

Parameters but no parameters

Oops!! Sounds funny......


I want to create a report. Report is created in EG and then a Stored Process is created out of it. The report should be with parameters (with prompt) so that the testing team can test the monthly/daily reports by entering the month and date parameters. The parameters may be "Month and Year" for Monthly reports and "Date" for Daily reports.

But acctually these reports are going to be scheduled later. i.e the Stored Process (.sas file) will be executed.

Can I create parameters with default values as Last month or Last Day so that when these reports are run through a schedule the parameters are NOT prompted and the default values are used.
Posts: 8,719

Re: Parameters but no parameters

When you register your stored process in the Metadata, using the Stored Process Wizard in EG (or using SAS Management Console) you CAN define a default parameter value, which will be used if there is nothing specified when the stored process is invoked (as when you write a custom app or invoke using the stored process web app.)

As described on this page:

Defining Parameters
Most stored process client interfaces allow a client to pass any input parameter. There is no requirement to define parameters before executing the stored process, but there are many advantages to describing parameters in stored process metadata:

--Parameter definitions can specify labels and descriptive text. This information can be used by client interfaces to present a more attractive and informative user interface. Other presentation options include grouping parameters and expert flags.

--Default values can be specified. The default value is used if the parameter value is not specified by the client.

--Default values can optionally be flagged as non-modifiable to allow a fixed parameter value to always be passed into a stored process. This can be useful when using an existing program that accepts many input parameters. You can register a new, simpler stored process that has some fixed value parameters and fewer client specified parameters.

You can also register multiple stored processes for a single program. Each stored process definition can pass in unique fixed parameter values to the executing program to force a particular operation or otherwise affect the execution of the stored process.

You could also control the value for input parameters using macro program logic, such as this:
%if &reptype = %then %let reptype = Date;

%if %upcase(&reptype) = DTAE %then %let reptype = Date ;

which is testing for a null value for &REPTYPE and setting the value for Date in the first %IF statement and doing a minor adjustment in the second %IF statement (in case you let them type the parameter value instead of choosing it from a drop down list).

But, macro conditional logic must be contained within a macro program, it is not allowed in "open" code. For more help with macro programs, you should consult the SAS Macro Facility documentation or contact Tech Support.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation