No announcement yet.

External Data Views

  • Filter
  • Time
  • Show
Clear All
new posts

  • External Data Views

    External Data Views

    When accessing data from the data management system through an outside process, such as a base sas program or from the ClinPlus Report tool, the data must be accessed through the SAS Share Service that is in use by the Data Management system. Although this can be done by assigning the required libraries directly to the Share Service (see post on assigning libname), it is not always convenient or because of conflicting libnames.

    An alternative is to create SAS Data Views with all of the library information embedded, including the SAS Share information. These views can then be accessed from SAS just by assigning a libref to the directory. This user report program provides a convenient way of creating all of the system and clinical data views for a project in the data management system.

    • A user defined library called EXVIEWS must be added to each study in CPDM that will use this process.
      • This is the folder that your external process will point to.
      • This library should not use Share.

    • The Server Name where the SAS Share Service is running must be specified in the program code.
      • The views cannot use an IP address.
      • See comments in the program code.
      • This can be modified either prior to importing or after importing the code to the report program.

    Adding the program and creating a template
    In System Administration / Reports / Report Library add the report code as follows:
    • Name: Create External Views
    • Type: Normal
    • Category: Utilities (or whatever makes sense for you)
    • Notes: Creates system and clinical data views with embedded library information
    • Import the program code
    • Save

    Note: The programs to create the external views can be found at the bottom of this post.

    Add Report Template
    In System Administration / Reports / Report Templates, add a new template as follows:
    • Name: Create External Views
    • Description: Creates system and clinical data views with embedded library information
    • Type: Normal
    • Category: Utilities (or whatever makes sense for you)
    • Report Type: Current Study Only
    • Program: Select program defined above (Create External Views)
    • No pre-process or post-process program
    • No Selection criteria is defined
    • Save template

    Running Report to Create Views
    From Study Information / Reports
    • Select Study
    • Select Report
    • Click Produce Report
    • If the library EXVIEWS is not defined or does not exist, a message will be displayed in a report.
    • If successful, a listing of views created should be displayed. Check the library folder to see if the views were created.

    Accessing Views
    From your other SAS process, assign a libref to the folder referenced as EXVIEWS. The name can be any valid libname.
    • This libname cannot use SAS Share or an error will be generated.
    • The share information is embedded into the views and will be processed when the views are processed.

    Example using views from Base SAS
    libname myviews 'C:\ClinPlus\CPDM321sr3\Studies\TestQueryPrintOrder\exviews';
    proc print data=myviews.enrollment;


    2/24/2010 - Added data set label to external view definition

    3/10/2010 - Corrected macro issue when paths contain special characters.

    6/20/2011 - Corrected check for EXVIEWS libname in process macro. It was initially checking for SASUSER.

    6/20/2011 -Added alternate program to create external views for Study System data (PSYS library).

    6/15/2012 -Defined global macro variables and removed unused pathname field.
    Attached Files
    Last edited by Greg Wagner; 09-02-2014, 01:07 PM. Reason: Added data set label