SAS batch program

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

SAS batch program

Im tring to program a SAS batch job to erase old data from a table of the EVM

 

i create a sas program (depuracion.sas) and i invoke this sas program a Linux sh script (depuracion.doc)

 

but the in the log i have a error:

-----------------------------------------------------------------------------------------------

NOTE: SAS initialization used:
      real time           1.98 seconds
      cpu time            0.43 seconds
      
^L2                                                          The SAS System                             14:44 Wednesday, June 22, 2016

1          %let  datte = %sysget(datte);
2          
3          /* options validvarname=any; */
4          
5          options
6              metaserver=clussaspvlmx11.mx.corp
7              metaport=8561
8              metauser="sasdemo"
9              metapass=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
10             metarepository=Foundation;
11         
12         libname arti123 base "/SAS94/config/Lev1/Web/SASEnvironmentManager/emi-framework/apm/Data/artifacts";
NOTE: Libref ARTI123 was successfully assigned as follows:
      Engine:        BASE
      Physical Name: /SAS94/config/Lev1/Web/SASEnvironmentManager/emi-framework/apm/Data/artifacts
13         
14         PROC SQL NOEXEC;
15            Delete *
16               FROM ARTI123.ARTIFACTUSAGEDETAILS t1
17               WHERE Datepart(t1.datetimeMinute) < '&datte.'d;
ERROR: Invalid date/time/datetime constant '&datte.'d.
18         QUIT;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.12 seconds
      cpu time            0.02 seconds
      
19         


ERROR: Errors printed on page 2.

NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
      real time           2.43 seconds
      cpu time            0.51 seconds

-----------------------------------------------------------------------------------------------

 

Does anyone have some idea of what I'm doing wrong?

Attachment

Accepted Solutions
Solution
‎06-23-2016 02:06 PM
Super User
Posts: 3,101

Re: SAS batch program

[ Edited ]

Try double quotes: WHERE Datepart(t1.datetimeMinute) < "&datte."d; Otherwise &datte will not resolve.

View solution in original post


All Replies
Solution
‎06-23-2016 02:06 PM
Super User
Posts: 3,101

Re: SAS batch program

[ Edited ]

Try double quotes: WHERE Datepart(t1.datetimeMinute) < "&datte."d; Otherwise &datte will not resolve.

New Contributor
Posts: 3

Re: SAS batch program

Thanks for your comment, this solve mi problemSmiley Very Happy

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 322 views
  • 0 likes
  • 2 in conversation