I've been trying to automate a vbs script (generated by Enterprise Guide 7.1) using Jenkins and am not able to troubleshoot the error. I've read many similar post here on sas community and have tried all the solutions that were suggested, but still having the issue. Please find the detailed explanation of the error below:
I'm trying to run the below script using Jenkins' Windows batch execution :
%windir%\System32\cscript.exe "~dir\EGScript1.vbs"
and I'm getting the error:
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.
~dir\EGScript1.vbs(7, 1) Microsoft VBScript runtime error: Object required
The vbs script works perfectly using command prompt and even with windows task scheduler.
After investigation, I found out that the issue is in creating this object Set app = CreateObject("SASEGObjectModel.Application.7.1"). For testing purpose I verified the line-- Set app = CreateObject("excel.application") which works perfectly fine (even in Jenkins).
I've tried all the options that were suggested including the links below:
https://communities.sas.com/t5/SAS-Enterprise-Guide/schedule-task-in-sas-eg/td-p/212052
https://communities.sas.com/t5/SAS-Enterprise-Guide/VBScript-error-could-not-locate-automation-class...
I'm using 64 bit machine and my EG is also 64 bit. I've also tried to run the below statement, but still getting the error of SASEGObjectModel.Application.7.1 using Jenkins.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm /codebase /tlb "C:\Program Files\SASHome\SASEnterpriseGuide\7.1\SASEGScripting.dll"
Please suggest and let me know if anymore info is required.
Thanks in advance.
A couple things to check...
Casey
Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF
View now: on-demand content for SAS users
A couple things to check...
Casey
Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF
View now: on-demand content for SAS users
Thank you Casey for the lead. Issue is resolved now.
I checked few things as you suggested:
Jenkins jobs were running under user- NT Authority\system
So I changed the LOG ON information in Jenkins service and restarted it.
Then I got a different error:
Failed to open SAS.Shared.DNADecoder. Reason: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.
LibGit2Sharp
Int32 git_libgit2_init()
at LibGit2Sharp.Core.NativeMethods.git_libgit2_init()
at LibGit2Sharp.Core.NativeMethods.LibraryLifetimeObject..ctor()
at LibGit2Sharp.Core.NativeMethods..cctor()
which I resolved using the below link :
https://communities.sas.com/t5/SAS-Enterprise-Guide/Execute-SAS-Program-via-VBA-LibGit2Sharp-Core-Na...
Since Jenkins' Windows batch command is invoked in "x86" (checked with 'whoami'). So I called my cscript using SYSNATIVE instead of SYSTEM32
%windir%\Sysnative\cscript.exe "~dir\EGScript1.vbs"
And now vbscript is able to create object SASEGObjectModel and entire program is running like a charm.
Thank you so much for your help.
Happy to help. Glad you got it resolved!
Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF
View now: on-demand content for SAS users
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.