Help using Base SAS procedures

Options to set some columns to read only in a sas data set

Reply
Contributor ykk
Contributor
Posts: 24

Options to set some columns to read only in a sas data set

I am developing a EG template for a project where in one of need is to allow the users to update a sas data set by opening it and we will be doing some validations on the updates done.Data set on which the user is doing updates has several columns and I don't want the user to be able to edit all the columns.I want to make some column readonly.

do we have any options in sas to achieve that.Can you please let me know of such options.

Super User
Posts: 5,424

Re: Options to set some columns to read only in a sas data set

First, I don't consider EG as an end user tool for updating data. The only exceptions could be system administrators and other situations for trusted users only.

Second, in Base SAS or in SAS metadata, there is no column level access control. It could be simulated using views, but this will not work for update.

So as a general advice would be to either develop a data entry application that could handle column level security, or use a data store that supports this kind of security, which includes SAS/SPD Server and many 3rd party RDBMS.

Data never sleeps
Super User
Super User
Posts: 7,942

Re: Options to set some columns to read only in a sas data set

Completely agree LinusH, have spent many hours working out a good way of getting data into SAS.  My opinion, RDBMS is probably most straight-forward as its built for that kind of thing and with ODBC connection access from SAS is real easy.  Datagrids + app can also be an option.  Please though, OP, don't immediately think "I know, what about Excel"!

Super User
Posts: 10,018

Re: Options to set some columns to read only in a sas data set

You can make a view to hide these read-only variable .

Occasional Contributor
Posts: 5

Re: Options to set some columns to read only in a sas data set

One option that might work, would be to split the table into two tables.  Pick a primary key or unique column to use for joining both tables using SQL.   Put the columns you don't want edited into the "master" table and the columns you will allow to be edited into the "slave" table.   Set the file ( of the Master table ) as read only. 

Super User
Super User
Posts: 7,942

Re: Options to set some columns to read only in a sas data set

The problem therein though would be how to display it to the user.  You would need to join the tables and show one table, which then goes back to the editable.  You may also want to consider and audit trail, Edit Checks etc.

Occasional Contributor pwe
Occasional Contributor
Posts: 11

Re: Options to set some columns to read only in a sas data set

Unlike LinusH, I think EG is a great tool for updating data. A custom-add in task would be a great solution offering both a good interface and the ability to create good editing rules.

Super User
Posts: 5,497

Re: Options to set some columns to read only in a sas data set

As you've been told, there are no simple options.  Here is one strategy that might work.

Create an EG process flow that takes these steps:

(1) Copy the table

(2) Let the user edit the copy (provide any messages you would like about what can be edited and what can't)

(3) Drop/keep variables from the edited copy

(4) Use the kept variables from the edited copy to update the original table

There are complications if the user edits by adding/deleting rows, but all of this can be overcome.

Good luck.

Trusted Advisor
Posts: 3,211

Re: Options to set some columns to read only in a sas data set

Why are your trying to do something as building a transactional approach that is common in OLTP systems using a RDBMS supporting full ACID?

I mentioned some abbrevations you are possible not aware off. This is the difference between an analytics environment  and a classic IT (cobol waterfall) approach.

Depending on your needs there could be some options. However do not expect SAS is a competitor of LAMP.  

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 8 replies
  • 584 views
  • 1 like
  • 8 in conversation