BookmarkSubscribeRSS Feed
tbittl
Calcite | Level 5

Hello,

I try to import an ODM XML file via PROC CDISC into SAS datasets.

The following script was used in the past but now it occur a syntax error.

Till now I spend a lot of time to solve the error but I did not found anything.

Here is the error message (regarding SASDATASETNAME....):

6                  ODMMINIMUMKEYSET=NO             USENAMEASLABEL=YES;
6   ! CLINICALDATA OUT=OUT.&DSET             SASDATASETNAME="&DSET"
                                                           -
                                                           22
                                                           76
6   ! SITEREF=YES             INVESTIGATORREF=YES;     RUN;

ERROR 22-322: Syntax error, expecting one of the following: COMMENT, DOMAIN, DOMAINCODE,

          NAME, ORIGIN, PURPOSE, SASDATASETNAME.

ERROR 76-322: Syntax error, statement will be ignored.

NOTE: The SAS System stopped processing this step because of errors.

I hope anybody in this community could help me.

Thanks in advance.

Kind regards,

Tanja

The following script I used:

/* Program Description:    Program to create a SAS dataset for every itemgroup within a XML ODM file */

/***** SAS Site number ********/

%put sitenumber: &SYSSITE;

/***** PROC CDISC VERSION *****/

proc cdisc version; run;

/************* ODM IMPORT **********************/

/* create filenames/libnames for XML ODM studydefs */

FILENAME XMLIMP 'Y:\...\dataexport_56881_2015-04-13_10-24-40.xml';

LIBNAME XMLIMP xml xmltype=CDISCODM FormatActive=No FormatNoReplace=No;

LIBNAME OUT 'Y:\...\SAS_data';

LIBNAME FLIB 'Y:\...\SAS_data';

%global DSETS;

/* MACRO for reading in ALL ItemGroups from ODM file in one step */

%MACRO ALLSETS (LIB, FLIB);

PROC SQL noprint;

SELECT UNIQUE MEMNAME INTO :DSETS SEPARATED BY '|'  

  FROM DICTIONARY.TABLES

  WHERE UPCASE(LIBNAME)="&LIB";

    %PUT DATASETS: &DSETS;

QUIT;

%LET NUM=1;

%LET DSET=%SCAN(%QUOTE(&DSETS),&NUM,|);

   %DO %UNTIL (%QUOTE(&DSET)=%STR());

      PROC CDISC MODEL=ODM

                 READ=XMLIMP

                FORMATACTIVE=YES

                FORMATNOREPLACE=NO                

                LANGUAGE="EN";

           ODM           ODMVERSION="1.2"

                             ODMMAXIMUMOIDLENGTH=20

                             ODMMINIMUMKEYSET=NO

                             USENAMEASLABEL=YES;

          CLINICALDATA OUT=OUT.&DSET

                  SASDATASETNAME="&DSET"

                  SITEREF=YES                     

                  INVESTIGATORREF=YES;          

        RUN;

        %LET NUM=%EVAL(&NUM+1);

        %LET DSET=%SCAN(%QUOTE(&DSETS),&NUM,|);

    %END;   

%MEND ALLSETS;

%ALLSETS (XMLIMP, FLIB);

1 REPLY 1
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

Whilst I don't use that toolkit, I could it be that you have a semi colon in the wrong place:

           ODM           ODMVERSION="1.2"

                             ODMMAXIMUMOIDLENGTH=20

                             ODMMINIMUMKEYSET=NO

                             USENAMEASLABEL=YES;               /* Here, is this semicolon valid? */

          CLINICALDATA OUT=OUT.&DSET

                  SASDATASETNAME="&DSET"

                  SITEREF=YES                    

If the above is ok, what does &DSET resolve to, do you have missing, or special characters?  options mlogic symbolgen mprint; then check that.  Also, I would as best practice, always put a full stop after the macro variable to ensure the compiler does not guess where the macro variable ends.

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 480 views
  • 0 likes
  • 2 in conversation