Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


saukkma
2012-04-12T08:29:24Z
I have several SAS barch jobs which are run with XP task scheduler.
Porting them to VC.

What should happen:

SAS creates data and shoves it up Excel + runs macros in the Excel workbook
The macros and export are done via DDE commands

When ran in SAS
result: works like a dream

When run with XP's task scheduler
result: Works like a dream

When run with VC:
result: SAS runs, opens up the Excel to export and DOES NOT RUN THE EXCEL MACROS!!
nore does SAS export anything to the Excel file

Smells like a problem in the DDE pipes.


so anybody ?: help, please.
Sponsor
Forum information
Support
2012-04-12T08:34:10Z
1. Do you use Background or Foreground mode on the Task?
2. Are you using the Execute Task?
3. Do you use Credentials?


Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
saukkma
2012-04-12T08:46:03Z
Originally Posted by: Support 

1. Do you use Background or Foreground mode on the Task?
2. Are you using the Execute Task?
3. Do you use Credentials?



Using Execute task, background, with Credentials (need access to networked resources)
RUn with API code
Support
2012-04-12T08:47:49Z
I think the problem is related to that macros are disabled in the current context. Please post some screenshots of your setup.

Also, please try using Foreground execution so we know if that works or not.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Support
2012-04-12T09:21:38Z
Also, we have not worked with SAS before but would like to get more "native" support. We see that they have an API here:

http://support.sas.com/d...de/customtasks/index.htm 

But, as we are not sure what you are doing perhaps you could help us in the right direction to find the appropriate API and method for what you are doing?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
saukkma
2012-04-12T09:48:27Z
Nope
Foreground doesnt work either.
Attached a pdf with info
Support
2012-04-12T09:57:03Z
So it gives an error "Cannot find the specified file"?

Either, it can't find the first sas.exe file or it cannot find the other files. Could you, as a test, copy the other files locally so we can see if that is the problem?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
saukkma
2012-04-12T10:36:44Z
Did some serious debugging and found the reason, i think
Seems Xp Task scheduler and VC behave totally differently when system asks for credentials with SAS command %SYSGET(username);

XP returns the user credentials for the TASK running
VC returns the ACCOUNT info for VC and not the user creds

see my little table

Service | Service account | User logon/task creds | SAS Getuser result
=============================================================================
VC | SYSTEM | B80861 | SYSTEM
XP | SYSTEM | B80861 | B80861

So it seems the impersonation / credentials are not always passed through to the 2nd level
Any suggestions other than changing the VC logon account ?
Support
2012-04-12T10:48:16Z
Have you checked "local logon" and "load profile" in the Credential that you use?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
saukkma
2012-04-13T08:19:09Z
Oh Yeah!!
Did some serious debugging and :

Problem solved , had to do some tweaking of SAS autoexec and login programs

Platform : XP 32-bit
Problem reason:

SAS command %SYSGET(username) returns the env.variable for the user who started the
program. In this case it is VC running on SYSTEM account.

Solution:
Add a environmental variable (System level) with a distinct name. I use BATCHUSERSAS
set it value to the username (login name) under which u want to run the SAS progs
By doing the check inside SAS users are able to run SAS in their own context and the VC context still keeps running.

Add this code to where ever you need in SAS progs
================== <code, ignore this line> ==============================
%LET devusr = %SYSGET(username);
%LET Batchuser = %SYSGET(BATCHUSERSAS);
/* Test if devusr = SYSTEM, if so substitute value to Batchuser env.var */

/*Create macro */
%MACRO SubstituteUser;

%if "&devusr"="SYSTEM" %then %do;
%LET devusr = &Batchuser;

%end;

%MEND;
/*Call macro*/
%SubstituteUser;

================== </code, ignore this line> ==============================
Support
2012-04-13T08:21:43Z
Thanks for info but did you ever try to change the "Credential" to Local login and Load profile. That should fix the startup of the process.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
saukkma
2012-04-13T08:32:44Z
Tried to local login and load options
No success..

so had to go into SAS.
Of what I understand of XP the local login and load option shouldve done the
thing but , alas, didnt.

Thanks anyway
Support
2012-04-13T08:34:39Z
Ok, what about our post about API:

Quote:

Also, we have not worked with SAS before but would like to get more "native" support. We see that they have an API here:

http://support.sas.com/d...e/customtasks/index.htm 

But, as we are not sure what you are doing perhaps you could help us in the right direction to find the appropriate API and method for what you are doing?


Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
saukkma
2012-04-13T09:44:09Z
LOL
I'm new to SAS also so cant comment on the API
trying to keep things simple and stupid, basic rule of IT
Scroll to Top