BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
diwakar_atwal
Fluorite | Level 6

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.

1 ACCEPTED SOLUTION

Accepted Solutions
CaseySmith
SAS Employee

A couple things to check...

  1. Is Enterprise Guide 7.1 installed on the machine on which your Jenkins job is running?
  2. What user account is your Jenkins job running under?  (add "whoami" command to your Jenkins job to confirm)  Perhaps it is running as a different user than yourself (ex. service account)?

Casey


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

View solution in original post

3 REPLIES 3
CaseySmith
SAS Employee

A couple things to check...

  1. Is Enterprise Guide 7.1 installed on the machine on which your Jenkins job is running?
  2. What user account is your Jenkins job running under?  (add "whoami" command to your Jenkins job to confirm)  Perhaps it is running as a different user than yourself (ex. service account)?

Casey


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

diwakar_atwal
Fluorite | Level 6

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.

CaseySmith
SAS Employee

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 5133 views
  • 4 likes
  • 2 in conversation