BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Patelbb
Fluorite | Level 6

Hi,

 

I was wondering if anyone could help me. My input statements don't seem to work for me for some reason. Can anyone see why and explain to me what I did wrong please? Thank you!

 

494  data dsmerged;
495     merge dstran  (in=inds)
496           suppds  (in=insup);
497     by usubjid;
498
499     length qval $200 icdate compdate relday 8.;
500     label qval = "Reason for disposition event"
501           icdate = "Informed Consent Date"
502           compdate = "Completion Date"
503           relday = "Number of Days on Study";
504
505     rename qval = dsreas;
506     format icdate compdate date9.;
507
508     ** Create the numeric variables for 2 new variables as indicated in the HW file;
509
510     icdate = input(INFORMED_CONSENT_OBTAINED, ?? date9.);
511     compdate = input(COMPLETED_STUDY, ?? date9.);
512
513
514     ** Create the RELDAY variable as indicated in the HW file;
515
516     relday = compdate-icdate + 1;
517
518  run;
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      77 at 516:21
NOTE: There were 77 observations read from the data set WORK.DSTRAN.
NOTE: There were 11 observations read from the data set WORK.SUPPDS.
NOTE: The data set WORK.DSMERGED has 77 observations and 12 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.06 seconds
 
 
1 ACCEPTED SOLUTION
6 REPLIES 6
andreas_lds
Jade | Level 19

Your input-statements generate missing values, calculations with missing-values always result in missing values. What do you expect as value for relday if compdate and/or icdate is missing?

 

if nmiss(compdate, icdate) = 0 then do;
  elday = compdate-icdate + 1;
end;
else do;
  elday = .;
end;

 

Patelbb
Fluorite | Level 6

I played around with the code a little more and this is what I have now but I'm still getting the same message.

 

47  data dsmerged;
648     merge dstran  (in=inds)
649           suppds  (in=insup);
650     by usubjid;
651
652     length qval $200 icdate compdate relday 8.;
653     label qval = "Reason for disposition event"
654           icdate = "Informed Consent Date"
655           compdate = "Completion Date"
656           relday = "Number of Days on Study";
657
658     rename qval = dsreas;
659
660     ** Create the numeric variables for 2 new variables as indicated in the HW file;
661
662     if INFORMED_CONSENT_OBTAINED ne '' then icdate = input(INFORMED_CONSENT_OBTAINED, mmddyy10.);
663     if COMPLETED_STUDY ne '' then compdate = input(COMPLETED_STUDY, mmddyy10.);
664
665
666     format icdate compdate 8.;
667
668     ** Create the RELDAY variable as indicated in the HW file;
669
670     relday = compdate-icdate + 1;
671
672  run;
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=0 STUDYID=ABC-123 DOMAIN=DS USUBJID=1160-2508 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2013-01-25 COMPLETED_STUDY=2013-04-25 WITHDREW_CONSENT=  QVAL=  FIRST.USUBJID=1 LAST.USUBJID=1
icdate=. compdate=. relday=. _ERROR_=1 _N_=1
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=1 STUDYID=ABC-123 DOMAIN=DS USUBJID=1160-2576 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2013-01-14 COMPLETED_STUDY=2013-06-10 WITHDREW_CONSENT=
QVAL=SUBJECT HAD 2 ADDITIONAL INJECTIONS. LAST DAY OF CONTACT IS AFTER30 DAYS POST 2ND ADDITIONAL INJECTION. FIRST.USUBJID=1
LAST.USUBJID=1 icdate=. compdate=. relday=. _ERROR_=1 _N_=2
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=0 STUDYID=ABC-123 DOMAIN=DS USUBJID=1160-2577 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2013-01-14 COMPLETED_STUDY=2013-04-04 WITHDREW_CONSENT=  QVAL=  FIRST.USUBJID=1 LAST.USUBJID=1
icdate=. compdate=. relday=. _ERROR_=1 _N_=3
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=0 STUDYID=ABC-123 DOMAIN=DS USUBJID=1160-2578 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2013-01-14 COMPLETED_STUDY=2013-04-01 WITHDREW_CONSENT=  QVAL=  FIRST.USUBJID=1 LAST.USUBJID=1
icdate=. compdate=. relday=. _ERROR_=1 _N_=4
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=0 STUDYID=ABC-123 DOMAIN=DS USUBJID=1160-2579 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2013-01-18 COMPLETED_STUDY=2013-03-27 WITHDREW_CONSENT=  QVAL=  FIRST.USUBJID=1 LAST.USUBJID=1
icdate=. compdate=. relday=. _ERROR_=1 _N_=5
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=1 STUDYID=ABC-123 DOMAIN=DS USUBJID=1160-2581 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2013-01-18 COMPLETED_STUDY=2013-05-14 WITHDREW_CONSENT=
QVAL=SUBJECT HAD ONE ADDITIONAL INJECTION. DATE OF LAST CONTACT IS 30 POST LAST ADDITIONAL INJECTION. FIRST.USUBJID=1
LAST.USUBJID=1 icdate=. compdate=. relday=. _ERROR_=1 _N_=6
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=1 STUDYID=ABC-123 DOMAIN=DS USUBJID=1160-2582 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2013-01-25 COMPLETED_STUDY=2013-06-13 WITHDREW_CONSENT=
QVAL=SUBJECT HAD ONE ADDITIONAL INJECTION. LAST DAY OF CONTACT IS 30 POST LAST ADDITIONAL INJECTION. FIRST.USUBJID=1
LAST.USUBJID=1 icdate=. compdate=. relday=. _ERROR_=1 _N_=7
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=0 STUDYID=ABC-123 DOMAIN=DS USUBJID=1160-2583 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2013-01-25 COMPLETED_STUDY=2013-04-25 WITHDREW_CONSENT=  QVAL=  FIRST.USUBJID=1 LAST.USUBJID=1
icdate=. compdate=. relday=. _ERROR_=1 _N_=8
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=1 STUDYID=ABC-123 DOMAIN=DS USUBJID=1160-2585 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2013-01-28 COMPLETED_STUDY=2013-06-03 WITHDREW_CONSENT=
QVAL=SUBJECT HAD ONE ADDITIONAL INJECTION. LAST DAY OF CONTACT WAS 30 DAYS POST THAT ADDITIONAL INJECTION. FIRST.USUBJID=1
LAST.USUBJID=1 icdate=. compdate=. relday=. _ERROR_=1 _N_=9
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=0 STUDYID=ABC-123 DOMAIN=DS USUBJID=1160-2586 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2013-03-25 COMPLETED_STUDY=2013-06-17 WITHDREW_CONSENT=  QVAL=  FIRST.USUBJID=1 LAST.USUBJID=1
icdate=. compdate=. relday=. _ERROR_=1 _N_=10
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=0 STUDYID=ABC-123 DOMAIN=DS USUBJID=1160-2587 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2013-04-01 COMPLETED_STUDY=2013-06-26 WITHDREW_CONSENT=  QVAL=  FIRST.USUBJID=1 LAST.USUBJID=1
icdate=. compdate=. relday=. _ERROR_=1 _N_=11
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=0 STUDYID=ABC-123 DOMAIN=DS USUBJID=1251-3626 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2012-11-07 COMPLETED_STUDY=2013-01-15 WITHDREW_CONSENT=  QVAL=  FIRST.USUBJID=1 LAST.USUBJID=1
icdate=. compdate=. relday=. _ERROR_=1 _N_=12
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=0 STUDYID=ABC-123 DOMAIN=DS USUBJID=1251-3627 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2012-12-12 COMPLETED_STUDY=2013-02-19 WITHDREW_CONSENT=  QVAL=  FIRST.USUBJID=1 LAST.USUBJID=1
icdate=. compdate=. relday=. _ERROR_=1 _N_=13
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=0 STUDYID=ABC-123 DOMAIN=DS USUBJID=1251-3628 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2013-01-07 COMPLETED_STUDY=2013-03-12 WITHDREW_CONSENT=  QVAL=  FIRST.USUBJID=1 LAST.USUBJID=1
icdate=. compdate=. relday=. _ERROR_=1 _N_=14
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=0 STUDYID=ABC-123 DOMAIN=DS USUBJID=1251-3629 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2013-01-15 COMPLETED_STUDY=2013-04-08 WITHDREW_CONSENT=  QVAL=  FIRST.USUBJID=1 LAST.USUBJID=1
icdate=. compdate=. relday=. _ERROR_=1 _N_=15
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=0 STUDYID=ABC-123 DOMAIN=DS USUBJID=1251-3630 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2013-01-17 COMPLETED_STUDY=2013-03-25 WITHDREW_CONSENT=  QVAL=  FIRST.USUBJID=1 LAST.USUBJID=1
icdate=. compdate=. relday=. _ERROR_=1 _N_=16
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=0 STUDYID=ABC-123 DOMAIN=DS USUBJID=1251-3631 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2013-01-28 COMPLETED_STUDY=2013-04-04 WITHDREW_CONSENT=  QVAL=  FIRST.USUBJID=1 LAST.USUBJID=1
icdate=. compdate=. relday=. _ERROR_=1 _N_=17
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=0 STUDYID=ABC-123 DOMAIN=DS USUBJID=1251-3632 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2013-01-28 COMPLETED_STUDY=2013-04-09 WITHDREW_CONSENT=  QVAL=  FIRST.USUBJID=1 LAST.USUBJID=1
icdate=. compdate=. relday=. _ERROR_=1 _N_=18
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
inds=1 insup=1 STUDYID=ABC-123 DOMAIN=DS USUBJID=1251-3633 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2013-02-13 COMPLETED_STUDY=2013-04-18 WITHDREW_CONSENT=
QVAL=PATIENT HAD ADDITIONAL INJECTION AND WAS SEEN ON 4/18/13 FOR MANIPULATION FIRST.USUBJID=1 LAST.USUBJID=1 icdate=.
compdate=. relday=. _ERROR_=1 _N_=19
NOTE: Invalid argument to function INPUT at line 662 column 53.
NOTE: Invalid argument to function INPUT at line 663 column 45.
WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.
inds=1 insup=0 STUDYID=ABC-123 DOMAIN=DS USUBJID=1251-3634 _NAME_=DSSTDTC _LABEL_=Start Date/Time of Disposition Event
INFORMED_CONSENT_OBTAINED=2013-02-20 COMPLETED_STUDY=2013-05-21 WITHDREW_CONSENT=  QVAL=  FIRST.USUBJID=1 LAST.USUBJID=1
icdate=. compdate=. relday=. _ERROR_=1 _N_=20
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      77 at 670:21
NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to
      missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      77 at 662:53   76 at 663:45
NOTE: There were 77 observations read from the data set WORK.DSTRAN.
NOTE: There were 11 observations read from the data set WORK.SUPPDS.
NOTE: The data set WORK.DSMERGED has 77 observations and 12 variables.
NOTE: DATA statement used (Total process time):
      real time           0.15 seconds
      cpu time            0.15 seconds
 
andreas_lds
Jade | Level 19

The problem is NOT the input-function, but the calculation using the variables set by the input-functions.

Astounding
PROC Star

You will need to inspect your data.  (Obviously, we can't help with that.)

 

These are the suspect variables:

 

INFORMED_CONSENT_OBTAINED

COMPLETED_STUDY

 

The programming statements expect these to be character, in the date9 format, something like:  04Mar2019

 

Somehow, the actual data doesn't match the expected values.  So the first step is to find out what is actually in these variables.

 

****************** EDITED:

 

So you are playing around with these:

 

date9.

mmddyy10.

 

without really understanding what they mean.

 

First, run a PROC CONTENTS to determine whether the two key variables are character or numeric.  Assuming they are character, their format in the log messages corresponds to:

 

yymmdd10.

 

Patelbb
Fluorite | Level 6

Ah got it thank you!!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 6 replies
  • 4306 views
  • 1 like
  • 4 in conversation