Help using Base SAS procedures

Command to know which scripts using which Data

Reply
Frequent Contributor
Posts: 148

Command to know which scripts using which Data

Hello,

Is there any command in SAS to check which scripts are using which library data

Is there anyway to check in Metadata level where the tables are getting used in script

or do we need to check all the scripts manually.

I would really appreciate for quick reply

Thank you

Valued Guide
Posts: 3,208

Re: Command to know which scripts using which Data

Use APM for dynamic access analyses.

The static analyses for library access in classic code is very hard, almost impossible.

DI metadata (that is the real "code") has all kind of relationships as impact analyses.

On what kind of SAS are you asking?   

---->-- ja karman --<-----
Frequent Contributor
Posts: 148

Re: Command to know which scripts using which Data

Coming to my SAS Environment its SAS 9.2 on Salaris.

and what kind of program or command i have to run inorder know which scripts are using which Library data.

I mean can i run from enterprise guide whatever the command or pogram thats available ?

Valued Guide
Posts: 3,208

Re: Command to know which scripts using which Data

So you can run SAS-scripting (programs) on Solaris. When you admins/sas people dislikes you they have closed it to that level (noxcmd).
If hey would trust you in you own environment you could run Unix-scritps (solaris) Groovy java Phyton and more of that kind of own build scripts (programs). It that xcmd setting as requirement for this. No problem when the setup is done running the WS on your personal key and the Unix is set up with security controls for isolating you not doing too much harm. Yep you could cause a heavy load and some are assuming that is a bad thing to prevent you doing that.     

As you are using Eguide you are having some things on Windows and you could use scritps (powershell batch) or Windows tools there.

You did not mention DI studio so that kind of source is getting out of scope.

In the mainframe with standards of good programming practices all allocations (filename/libname) are not allowed to be in programs but are isolated in dedicated start/autoexec files. It is a requirement as result of segregations Develop Test Acceptance Production having executable code mot allowed to be changed in a change proces.  As of your question you are not following this kind of good programming practice.

The question now where is the code (source version) located and how is the libname regonizable coded. There will be no 100% guarantee as the coding can be done to obfuscate these functions intentionally or unintentionally.

Your source is on Solaris in readable form. -> use Unix scan/find commands to find those strings in known locations.

Your source is within in Eguide -> this a zip file, use Zip scanners to find those statement in these files on Windows 

Your source is stored in readable form on Windows -> you can uses Windows scanners to find those SAS statements

Your source is stored as Eguide project in SAS metadata (9.3). You are on a dead with other tools and SAS does not have anything.           

---->-- ja karman --<-----
Frequent Contributor
Posts: 148

Re: Command to know which scripts using which Data

Jaap Karman,

Thank you very much for the solution,I appreciate it.

We have an issue for users going on with SAS AMO 5.1 for past 1 week.

we are using SAS 9.2 on Solaris (Microsoft Excel 2010)

Our SAS AMO is published as an APP on Citrix server for all our users,so all our users are logging and accessing from citrix server to run their reports.SAS AMO is not installed on users machines.

couple of users have got a problem with SAS AMO,for the past 1 week they are not able to see SAS Tab on SAS AMO.
we trouble shooted it in several ways with all below options.

File menu--Options--Add-ins--Manage--COM Add-Ins and checked SAS Add-In 5.1 for Microsoft office.
we checked File menu--Options--Add-ins--Manage--Disabled items also.It looks Enable is greyed out
(There are no disabled items)

but still they could'nt see the SAS Tab,again followed same above steps to see COM-Add-Ins box i found
the SAS Add-In 5.1 for Microsoft office again unchecked.

I can see a runtime error at the bottom of the COM-Add-ins window

Load Behavior : Not loaded. A runtime error occured during the loading of the COM Add-in.

As per SAS Note I have installed on user  machine VSTO component for above error and I had make sure that VSTO got installed in below location.but still the Issue is not resolved.

C:\Program Files\Common Files\Microsoft Shared\VSTO\10

Followed below sas webesite instructions for above error and downloaded and installedd VSTO component.

http://support.sas.com/kb/50/561.html


http://support.sas.com/kb/41/327.html

Please can you help me on this issue,I would really appreciate for your suggestions and help.

even sas support failed to provide proper solution on this

Thank you for all your help in advance

Frequent Contributor
Posts: 148

Re: Command to know which scripts using which Data

Jaap karman,

am not able to find  any script or code to use to run in Unix machine or EG to find out which are all the scripts using which Libraries Data.

by any chance do you have any idea what is that code to find that.

please help me

Thank you

Valued Guide
Posts: 3,208

Re: Command to know which scripts using which Data

There are just some commands doing that. The names of those (files and grep) egrep(1): print lines matching pattern - Linux man page  (output with filename/linenumber)

xargs - Wikipedia, the free encyclopedia en you will find a lot on those like The Joys of xargs - xargs and find - Tutorials - LinuxPlanet   You will have to go for searching the "libname" string.

Remember it could be have hidden some things as it is not in the code maybe elsewhere. 

---->-- ja karman --<-----
Frequent Contributor
Posts: 148

Re: Command to know which scripts using which Data

SAS EG-Data Grid Error

An unexpected error occured while attempting to read the data values.Do you wish to retry or cancel ?


System.IndexoutofRangeException: Index was outside the bounds of the array.
at SAS.EG.DataAccess.DataModel.DmSasRioPageBuffer.Populate(Int32 startingRecordNumber,DataAccessor dataAccessor,Double[,] numericColValues,String[,] characteColValues)

at SAS.EG.DataAccess.DataModel.DaForSasData.BufferData(Int32 startRecord,Boolean formatted,Double[,] numColValues,String[,] charColValues).

at SAS.EG.DataAccess.DataModel.DaForSasData.CommomReadPage(Int32 record,Boolean formatted,Int32 readFlags,Int32 offset,Byte[] positionBookmark,Byte[] & bookmarks,Int32& recordRead)
---------------------------
-----------------------
-----------------------

Error follows like this...did'nt typed complete error

When one of the user is trying to open a dataset from a oracle library he is getting below error.

When I tried to open the same dataset from my system, am able to open it without any problem.

I suggested user to run the libname statement of that oracle library from his system, but when he tried to run it has thrown below error

“ERROR: ORACLE connection error: ORA-01017: invalid username/password; logon denied. ERROR: Error in the LIBNAME statement.”

When I tried to run the same libname statement from my system its running successfully without any error.

I preassigned that library and even I gave permissions to that user for that library and table. but still same error.

What could be the problem ? Any ideas

Super User
Posts: 3,110

Re: Command to know which scripts using which Data

I suspect the user does not have the right permissions for accessing the Oracle database but you do. Check with your Oracle DBA to confirm. Once your use is set up correctly re-try the LIBNAME. 

Frequent Contributor
Posts: 148

Re: Command to know which scripts using which Data

Jaap Karman,

Thank you so much for your prompt response,I appreciate it.

actually I gave full permissions except delete permissions to that user on that library and table also from SAS Management console.

but when he tried to open that dataset in the oracle library it has thrown with below error in a pop-up window with name "Data grid error"

An unexpected error occured while attempting to read the data values.Do you wish to retry or cancel ?


System.IndexoutofRangeException: Index was outside the bounds of the array.
at SAS.EG.DataAccess.DataModel.DmSasRioPageBuffer.Populate(Int32 startingRecordNumber,DataAccessor dataAccessor,Double[,] numericColValues,String[,] characteColValues)

at SAS.EG.DataAccess.DataModel.DaForSasData.BufferData(Int32 startRecord,Boolean formatted,Double[,] numColValues,String[,] charColValues).

at SAS.EG.DataAccess.DataModel.DaForSasData.CommomReadPage(Int32 record,Boolean formatted,Int32 readFlags,Int32 offset,Byte[] positionBookmark,Byte[] & bookmarks,Int32& recordRead)
---------------------------
-----------------------
-----------------------

Error follows like this...did'nt typed complete error

and I suggested to run libname statement of that oracle library from his EG 5.1 and try opening the dataset again,but it has thown below error.

“ERROR: ORACLE connection error: ORA-01017: invalid username/password; logon denied. ERROR: Error in the LIBNAME statement.”

but i can able to open that dataset and i can run libname statement successfully.

what are all the reasons for getting this type of error and what are all the comman and possible options we have to trouble shoot this kind of error,please suggest.I would really appreciate your help.

Valued Guide
Posts: 3,208

Re: Command to know which scripts using which Data

The SAS Management Console isn't Oracle does it?

You can register Tables in the SAS Metadata, you can even register the record-layouts of Oracle tables (design purposes)

You can also store the Oracle password (user/psw) in the SAS metadatabase.

As you are having access to that stored password you can read that and use it in your own plain SAS-code

As you tried that and getting the ORA-0107 error you have got the message Oracle does not like the user/password from you or the sas-metadata.

Would someone really believe SAS is overruling any access in Oracle or the OS level?

Someone (or too many) at SAS institute do as they are promoting this belief asking for root and sysadmin keys of those DBMS-systems.

Do not believe these guys, just go to the Oracle admin, validate the Dbase access as of the Oracle controls.

Verify this is working in some plain-code and avoid any metadata registered tables. Than after this continue to SAS environment.  

You are probably getting an error from some SAS metadata access where the real cause is being excluded from Oracle access.     

---->-- ja karman --<-----
Frequent Contributor
Posts: 148

Re: Command to know which scripts using which Data

Thanks for your response

The only thing surprises me is that why am able to open that dataset and able to run libname statement without error and why can't the user not able to open dataset and run libname without any erros.

I gave ful permissions also to user for that partcular oracle library and table.

she was able to open before those tables and why can't now ?

and also am really apologize to post a different question in this note.

other than using top and ps -ef | grep commands do you have any idea
what are the ways to find below information on my current SAS 9.2 environment.


Existing SAS environment


What is the configuration of the current server(s) 
How many and what type of cores (model and clock speed)   
How much memory  


Approximate Peak Times Utilization


How many concurrent SAS jobs are being executed
What is the typical/maximum number of concurrent sessions executing around peak time 
What is the average/maximum CPU utilization  
What is the average/maximum memory utilization  

Super User
Posts: 5,257

Re: Command to know which scripts using which Data

Upgrade to 9.4, there are many more tools available from SAS, like the Environment Manager.

Data never sleeps
Valued Guide
Posts: 3,208

Re: Command to know which scripts using which Data

@linus do you really think the SAS tools they are promoting can overrule and replace the common ones with the common business requirements adjustments?

For example Selinux with confinement monitoring and auditing with segregated roles as being mandatory.

---->-- ja karman --<-----
Valued Guide
Posts: 3,208

Re: Command to know which scripts using which Data

"I gave ful permissions also to user for that particular oracle library and table."
This only SAS view forget that, the real thing: where does the ora user/password coming from?

Did the ora-password change or got locked as result of common access policies?  (A shared group-account sounds nice for an installer but is bad for compliancy)

A SAS environment can be well described look at SASHFADD  SAS Hot Fix Analysis, Download and Deployment Tool (SASHFADD)

The hardware of (bare Iron) should be asked at that level. Not all things can be seen from software.

Oslevel give some on that oslevel | /bin/help LINUX REFERENCE  ask for topas with nmon or alikes for all OSlevel tools.

vmstat and those tools wil give you how the OS is running. Nmon (or alike) is keeping logfiles as of building up historical trends.

Do not value average too much as it is related to some interval experience. An average of 24hrs has a different meaning on the experience as those on 1 minutes. Every measurement is related to time with some accuracy (Heisenberg).

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 28 replies
  • 642 views
  • 0 likes
  • 5 in conversation