Announcement

Collapse
No announcement yet.

COVER Program using two datasets

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • COVER Program using two datasets

    From: Ronni Rubenstein [mailto:[email protected]]
    Sent: Thursday, March 30, 2006 9:07 AM
    To: Joe Reed; Support
    Subject: RE: COVER programs

    Hi Joe,

    Attached is a COVER program that should work with the TrainingStudy, which was set up during training. It uses two data sets instead of just one, which is in the training manual. Let me know if this helps.

    Code:
    ***************************************************;
    ***** ClinPlus Data Management **************************;
    ***** COVER PROGRAM SHELL      *************************;
    ***************************************************;
    
    *** Primary data set association to draw data from ***;
    %PRIMARY(DEMOG);
    
    *** Secondary data set association to draw data from ***;
    %SECONDARY(MEDHIST);
    
    *** Other data set without association to COVER process ***;
    * %OTHER(<other data set>);
    
    
    proc sort data=work.demog out=work.tmpdemog;
    by INVESTIGATORNUMBER PATIENTNUMBER;
    run;
    proc sort data=work.medhist out=work.tmpmedhist;
    by INVESTIGATORNUMBER PATIENTNUMBER;
    run;
    
    DATA WORK.DEMOG_MEDHIST;
    MERGE WORK.tmpDEMOG WORK.tmpMEDHIST(KEEP=INVESTIGATORNUMBER PATIENTNUMBER STARTDAY STARTMO STARTYR DISEASE);
    BY INVESTIGATORNUMBER PATIENTNUMBER;
    RUN;
    
    proc sort data=WORK.DEMOG_MEDHIST nodup;
    by INVESTIGATORNUMBER PATIENTNUMBER;
    run;
    
    ******************************************************;
    *** QUERIES LINKED TO RECORDS ****************************;
    ******************************************************;
    
    DATA WORK.COVERQUERIES(KEEP=DATESTAMP1-DATESTAMP5
                          VARIABLES1-VARIABLES5
                          QUESTIONCODE QUESTION
                          PROMPT);
          LENGTH DATESTAMP1-DATESTAMP5 8.
                 VARIABLES1-VARIABLES5 $1000.
                 QUESTIONCODE $20.
                 QUESTION PROMPT $5000.;
    
          SET WORK.DEMOG_MEDHIST;
    
          *** INITIALIZE DATETSTAMPS ***;
          DATESTAMP1=DATESTAMP1;
          DATESTAMP2=DATESTAMP2;
          DATESTAMP3=DATESTAMP3;
          DATESTAMP4=DATESTAMP4;
          DATESTAMP5=DATESTAMP5;
    
          *** INITIALIZE VARIABLES ***;
          VARIABLES1=VARIABLES1;
          VARIABLES2=VARIABLES2;
          VARIABLES3=VARIABLES3;
            VARIABLES4=VARIABLES4;
          VARIABLES5=VARIABLES5;
    
    
          DEMOGDATE=.;
          %datew(m=birthmo, d=birthday, y=birthyr, numdate=DEMOGDATE);
          MEDHISTDATE=.;
          %datew(m=startmo, d=startday, y=startyr, numdate=MEDHISTDATE);
    
    
          *** QUESTION EXPRESSION (Hard Coded Question) ***;
          if DEMOGDATE=. then do;
                question="The birth date is not valid.";
                prompt="";
    
                variables1="birthday birthyr birthmo";
    
                output;
          end;
    
          if DEMOGDATE>MEDHISTDATE AND DEMOGDATE>. AND MEDHISTDATE>. then do;
                question="The birthdate is after the disease date.";
                prompt="";
    
                variables1="birthday birthyr birthmo";
    
                output;
          end;
    
    RUN;

    Ronni Rubenstein
    Software Trainer
    DZS Software Solutions, Inc.
    1661 Route 22 West
    Bound Brook, NJ 08805
    +1 732 764 6969 x223
    [email protected]

    --------------------------------------------------------------------------
    From: Joe Reed
    Sent: Wednesday, March 29, 2006 6:14 PM
    To: Support
    Subject: COVER programs

    Hello,

    I'm working on setting up computerized data queries and was wondering if you have any tips and/or materials related to this. I've been through the data management training manual and read the online help documents. I can produce simple queries similar to the example in the training manual, but would like to write my own SAS programs and submit to the cover processing module.

    I'm trying to understand the structure of the input and output datasets and what is going on during the processing. I've been able to find a small amount of information on the work.coverqueries and work.generalqueries datasets.

    Thanks,
    Joe
    Attached Files

  • #2
    Program Feedback (out, log, &amp; results) besides the queries produced.

    Joe,

    I mostly program my COVER programs in Base SAS and use many “proc print” and “%put” statements to help me know what is going on with the data. After debugging the code so it works as expected in Base SAS I put it into the COVER processing inside ClinPlus.

    Sometimes it works great! However it usually still needs some modification. The visual feedback is less apparent, but I've found that I can still get to it by typing (in the command line at the top) "out" then pressing <enter>, which shows you the output screen. Also, the tool bar changes to the customary one for Base SAS where you can select View>Results. However, before the system lets me run my COVER programs again I must first close the results window.

    I've also got a question that I'm hoping someone can help me with. Sometimes when I write a COVER program that merges 2 datasets I get no completion errors, but when the program results are being displayed, the title bar shows "Invalid/Missing DATASTAMP Links Found for <Name I had put as the Primary Dataset>"

    What causes this, and how can it be avoided?

    Robert

    Comment


    • #3
      Hi Robert,

      Can you send me a program that causes "Invalid/Missing DATASTAMP Links Found for <Name I had put as the Primary Dataset>" and I'll take a look. Please send to [email protected].

      Bob

      Comment

      Working...
      X