DATA Step, Macro, Functions and more

Using Task Scheduler to Run SAS

Accepted Solution Solved
Reply
Contributor
Posts: 33
Accepted Solution

Using Task Scheduler to Run SAS

Good morning all,

OK I've researched this for a couple of days but still can't get the Task Scheduler to run my program.  It runs fine manually.  I'm setup with administrative access so that's not the issue.  I'm running 64 bit Windows 7 Proffesional.  The wierd thing is I don't see any errors in the task history pane, and the program opens, but then closes without actually running.  Here's the content of my script file:

"C:\Program Files (x86)\SAS\SASFoundation\9.2(32-bit)\sas.exe" -SYSIN "\\nasdr\c_commodity_acctg\Workfiles\Steve\SAS\ERCOT\NSS Daily Backdown.SAS" -LOG "C:\Temp\DailyBackdown.log" -PRINT "C:\Temp\DailyBackdown.lst"

And here's a snipet of the log file from Task Scheduler:

WARNING: Truncated record.
69         int_1,    int_2,    int_3,    int_4,    int_5,    int_6,    int_7,    int_8,    int_9,
69       !    int_10,    int_11,    int_12,    int_13,    int_14,    int_15,    int_16,    int_17,
69       !     int_18,    int_19,    int_20,    int_21,    int_22,    int_23,    int_24,    i
70        
71         from stlmnt.iso_determinant_day iso
72        
73          where iso.determinant_id = '5'
74          and iso.operation_dt between &BD_Date1 and &BD_Date2
75          and iso.location_id in
75       ! ('232','234','568','233','104','584','236','235','237','567','282','103')
76        
3                                         The SAS System               07:53 Monday, July 13, 2015

77         order by iso.location_id, iso.operation_dt );
ERROR: ORACLE prepare error: ORA-00904: "I": invalid identifier. SQL statement:......

NOTE: Statement not executed due to NOEXEC option.


Accepted Solutions
Solution
‎07-13-2015 09:16 AM
Occasional Contributor
Posts: 11

Re: Using Task Scheduler to Run SAS

I think your issue is that one of the lines in your program is too long for batch mode.  There is a limit of 256 characters, see this page http://support.sas.com/kb/5/953.html.

View solution in original post


All Replies
Solution
‎07-13-2015 09:16 AM
Occasional Contributor
Posts: 11

Re: Using Task Scheduler to Run SAS

I think your issue is that one of the lines in your program is too long for batch mode.  There is a limit of 256 characters, see this page http://support.sas.com/kb/5/953.html.

Contributor
Posts: 33

Re: Using Task Scheduler to Run SAS

Yes!  Thank you!  A lot of re-coding to do but that worked, thanks so much!

Steve

Super Contributor
Super Contributor
Posts: 3,174

Re: Using Task Scheduler to Run SAS

Consider the opportunity to move some part of your SYSIN to a separate file (containing the SAS code-piece), and then use a %INCLUDE statement to invoke that code in-line where needed within your base SAS program.

Scott Barry

SBBWorks, Inc.

🔒 This topic is solved and locked.

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

Discussion stats
  • 3 replies
  • 367 views
  • 0 likes
  • 3 in conversation