Appendix D: %run_p21v SAS macro

In this appendix, we present the %run_p21v SAS macro that is used in Chapter 9 to validate our CDISC implementations using Pinnacle 21 software in batch mode. The program is annotated with numbered bullets for additional commentary that appears at the end of this appendix.

%run_p21v SAS Macro

*-------------------------------------------------------------------------;

* Run the Pinnacle 21 Community Validator in batch mode                   ;

*  TYPE= The standard being validated (SDTM, ADaM, Define, SEND, or

*   Custom)

*  SOURCES= Path of the directory that contains the SAS datasets or

*   define file

*  P21Path= Path of the local OpenCDISC Validator installation

*  ValidatorJAR= Subdirectory and name of the JAR file

*

*  FILES=       Defaults to all .xpt files in the directory. Alternatively,

*               one specific file could be specified or a wildcard could

*               be used on a partial name (e.g. LB*.xpt)

*

*  REPORTFNAME= Name of the output Excel file that contains the validation

*               report.  Can be left blank to have automated naming occur.

*

*  CONFIG=      Subdirectory and name of the configuration file to be

*               used for validation.  Should correspond to one of the

*               files in the CONFIG sub-directory.

*

*  DEFINE=Y    Choose Y, y, or 1 if a DEFINE.XML file exists (in the

*              same directory as the data sets) for cross-validation.

*              Do NOT choose DEFINE=Y/y/1 if you wish to validate a

*              define file.

*

*  CTDATADATE= Specify the version of the controlled terminology XML file

*              used to check against.  Since the file locations and names

*              are standardized, all that is needed is the date in

*              yyyy-mm-dd format. There are many different versions from

*              which to choose and these are updated frequently.  Refer

*              to your P21 software and/or the COMPONENTSCONFIGDATACDISC

*              directory for CDISC controlled terminology.  

*

*  MAKE_BAT=N  Specify Y if a .BAT file is desired.  The .BAT file can

*              be submitted/typed at a command prompt (without the .BAT

*              extension) to initiate the process of having a validation

*              report generated (without having to resubmit this macro)

*-------------------------------------------------------------------------;

%macro run_p21v(type= ,

                sources= ,

                ctdatadate= ,

                p21path=C:Softwarepinnacle21-community,        

                validatorjar=componentslibvalidator-cli-2.1.0.jar,  

                files=*.xpt,

                reportfname= ,

                config= ,

                define=Y,

                make_bat=N

                );

                     

    ** set the appropriate system options;

    options symbolgen xsync noxwait ;

                         

    ** specify the output report path;

    %let reportpath=&sources;                                   

    

    ** ensure proper capitalization in case of case sensitivity;

    %if %upcase(&type)=ADAM %then

      %let type=ADaM;

      

    ** specify the name(s) of the validation reports;       

    %if &reportfname^= %then

      %let reportfile=&reportfname;

    %else %if %upcase(&type)=SDTM %then

      %let reportfile=sdtm-validation-report-&sysdate.T%sysfunc(tranwrd(&systime,:,-)).xlsx;

    %else %if %upcase(&type)=ADAM %then

      %let reportfile=adam-validation-report-&sysdate.T%sysfunc(tranwrd(&systime,:,-)).xlsx;

    %else

      %let reportfile=p21-community-validation-report-&sysdate.T%sysfunc(tranwrd(&systime,:,-)).xlsx;

    ;

    

    ** specify the name(s) of the configuration file (if missing);

    ** (note that the names of the configuration files can change with new CDISC

    ** IGs and software releases so maintenance of this is required!!);

    %if &config= %then

      %do;

        %let configpath=&p21pathcomponentsconfig;

        %if %upcase(&type)=SDTM %then

          %let config=&configpathSDTM 3.2.xml;

        %else %if %upcase(&type)=ADAM %then

          %let config=&configpathADaM 1.0.xml;

        %else %if %upcase(&type)=DEFINE %then

          %do;

            %let config=&configpathDefine.xml.xml;          

            %** ensure that [&]DEFINE=N in this case;

            %let define=N;

          %end;

      %end;

      

    %** cross-check against a define file?  if so, assume it exists in the same directory and is

    %** named simply define.xml ;

    %** if validating a define, then use [&]files as the define file name;

    %if %upcase(&type)=DEFINE %then

      %let config_define=%str(-config:define="&sources&files");

    %else %if %upcase(&define)=Y or &define=1 %then

      %let config_define=%str(-config:define="&sourcesdefine.xml");

    %else

      %let config_define= ;

    ;

    

    %** if ctdatadate is non-missing, then check controlled terminology against the corresponding file;             

    %if "&ctdatadate"^= "" %then

      %do;

        %let tdata=&p21pathcomponentsconfigdataCDISC&type&ctdatadate

&type Terminology.odm.xml;

        %let config_codelists=%str(-config:codelists="&ctdata");

      %end;

    %else

      %let config_codelists= ;

    ;

    

    %put submitting this command: ;

    %put java -jar "&p21path&validatorjar" -type=&type -source="&sources&files" -config="&config"

         &config_codelists &config_define -report="&reportpath&reportfile" -report:overwrite="yes" ;

      

    * run the report;

    x java -jar "&p21path&validatorjar" -type=&type -source="&sources&files" -config="&config"

      &config_codelists &config_define -report="&reportpath&reportfile" -report:overwrite="yes" ; *> &sources un_p21v_log.txt;

 

    %if &make_bat=Y %then

      %do;

        * send the command to a bat file;

        data _null_;

        

            file "&sourcessubmit_p21_&type._job.bat" ;

            put 'java -jar "' "&p21path&validatorjar" '"' " -type=&type -source=" '"' "&sources&files" '" -config="' "&config" '"'

                " %bquote(&config_codelists) %bquote(&config_define) -report=" '"' "&reportpath&reportfile" '"' ' -report:overwrite="yes" ';

        run;

      %end;

 

%mend run_p21v;

Additional SAS Code Comments

   The root path of the Pinnacle 21 Community software installation will need to be customized for your environment and should be done here.

   New versions of the software will have new names for the JAR files that correspond to the software version number. So these will need to be maintained when the software is updated.

   A static file name can be provided via the REPORTFNAME macro parameter. Otherwise, the macro will create a dynamic name that uses the system date/time in the file name. This is similar to how the software operates in the GUI mode. For example, if validating an SDTM file on August 27, 2016 at 8:27 in the morning, the name of the validation report will be sdtm-validation-report-27AUG16T08-27.xlsx. If a static name is not provided and the validation being done is not for SDTM or ADaM, then the validation report will be named p21-community-validation-report-27AUG16T08-27.xlsx

   Similar to the JAR files, the names for configuration files can change with new releases of, for example, implementation guides. Note also that most standards now have two versions of the configuration file—one for FDA rules and one for PMDA rules. For example, the SDTM IG version 3.1.3 the file names are “SDTM 3.1.3 (FDA).xml” and “SDTM 3.1.3 (PMDA).xml”.

   Note that if you are validating a define file, there should not be any cross-checking with the define file because you can’t cross check a file with itself. So whatever value is provided for the DEFINE macro parameter is ignored and this is set to N if the TYPE parameter is set to DEFINE.

   The controlled terminology files have a standard folder structure and naming convention. If we already know the standard being implemented (e.g. SDTM, ADaM), then the date corresponding to the release of the controlled terminology used for your implementation can be provided in the CTDATADATE parameter in YYYY-MM-DD format. This should correspond to the folder names in the ..componentsconfigdataCDISC[standard type] subdirectories.

   Rather than repeatedly running this macro for the iterative validation process, you can instead have the macro create a .BAT file that you can either manually run at the command line or have SAS run via the X command. If doing this, however, you may want to supply a static filename for the REPORTFNAME macro parameter rather than having a dynamic date/time-based name specified at the time of the macro execution that may become quickly outdated.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset