[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


%SYSFUNC doesn't work

Posted on 2011-05-13
Medium Priority
Last Modified: 2013-11-16

The following instruction gives a fault :
%LET start = 20110301 ;

    %LET strt   = %SYSFUNC(INPUTN(&start,DATE9.)) ;
    %LET strt2  = %SYSFUNC(PUTN(&start,DATE9.)) ;

WARNING: Argument 1 to function INPUTN referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range.
NOTE: Mathematical operations could not be performed during %SYSFUNC function execution. The result of the operations have been set to a missing value.
Question by:sonmic
LVL 14

Expert Comment

by:Aloysius Low
ID: 35752444
do not use %let within data steps.
what you can do is to compute the value and use call symput to put the value into the global variables:

    strt   = INPUTN(&start,DATE9.) ;
    strt2  = PUTN(&start,DATE9.) ;

    call symput("strt", strt);
    call symput("strt2", strt2);
LVL 11

Accepted Solution

theartfuldazzler earned 2000 total points
ID: 35752533

The %Let statememt will work, whether it is in a DATA step or not.

The problem is that you are using the wrong format.

%LET start = 20110301 ;
  %LET strt   = %SYSFUNC(INPUTN(&start,yymmdd8.)) ;
    %LET strt2  = %SYSFUNC(PUTN(&strt,DATE9.)) ;

%Put strt2 = &strt2 | start = &start | strt = &strt;

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question