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

Even the rows 8,9,10 with ids like 100-09080??

art297
Opal | Level 21

Looks correct to me. I've attached copies of the output.

 

Art, CEO, AnalystFinder.com

Kurt_Bremser
Super User

Always read ID variables as character:

data want;
infile cards dlm=',' dsd truncover;
input
  ID :$10.
  Date :mmddyy10.
  consolidated :$20.
  Ag_Ab_OR1
  Ag_Ab_S_CO1
  Ag_Ab_Od2
  Ag_Ab_a_O2
  Ag_Ab_OD3
  Ag_Ab_a_O3
  Antigen :$1.
  Antibody :$1.
  STI :$1.
  V_1_supplemental :$20.
;
label
  ID = 'ID'
  Date = 'Date'
  consolidated = 'consolidated'
  Ag_Ab_OR1 = 'Ag_Ab OR1'
  Ag_Ab_S_CO1 = 'Ag_Ab S/CO1'
  Ag_Ab_Od2 = 'Ag_Ab Od2'
  Ag_Ab_a_O2 = 'Ag_Ab a/O2'
  Ag_Ab_OD3 = 'Ag_Ab OD3'
  Ag_Ab_a_O3 = 'Ag_Ab a/O3'
  Antigen = 'Antigen'
  Antibody = 'Antibody'
  STI = 'STI'
  V_1_supplemental = 'V-1_supplemental'
;
format
  date mmddyy10.
;
cards;
98888888,6/12/2011,Reactive,0.089,0.099,0.678,,,,-,+,,
97777777,6/27/2010,non-reactive,0.987,,0.567,11.5,,,-,-,,negative
96543216,8/1/2007,Reactive,,0.987,,33.33,,5.78,+,-,,
97778881,10/3/2006,Reactive,0.099,,0.456,23.22,6.89,,-,+,,equal
92188881,4/4/2009,non-reactive,0.876,0.777,,,,,+,-,,positive
92222227,1/14/2010,d/c-TT+,0.678,0.543,0.345,,,,-,-,-,
100-09080,2/14/2011,,,,,,,,,,,
200-08070,,,0.789,,,,,,,,,
100-50678,3/24/2008,d/c-TT+,,8.9,,34.56,78.9,6.9,,,,negative
;
run;

proc print data=want label noobs;
run;

Clean log, and clean result:

                                        Ag_Ab   Ag_Ab   Ag_Ab   Ag_Ab   Ag_Ab   Ag_Ab
   ID             Date   consolidated    OR1    S/CO1    Od2     a/O2    OD3     a/O3   Antigen   Antibody   STI   V-1_supplemental

98888888    06/12/2011   Reactive       0.089   0.099   0.678     .       .       .        -         +                             
97777777    06/27/2010   non-reactive   0.987    .      0.567   11.50     .       .        -         -                 negative    
96543216    08/01/2007   Reactive        .      0.987    .      33.33     .      5.78      +         -                             
97778881    10/03/2006   Reactive       0.099    .      0.456   23.22    6.89     .        -         +                 equal       
92188881    04/04/2009   non-reactive   0.876   0.777    .        .       .       .        +         -                 positive    
92222227    01/14/2010   d/c-TT+        0.678   0.543   0.345     .       .       .        -         -        -                    
100-09080   02/14/2011                   .       .       .        .       .       .                                                
200-08070            .                  0.789    .       .        .       .       .                                                
100-50678   03/24/2008   d/c-TT+         .      8.900    .      34.56   78.90    6.90                                  negative    

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 17 replies
  • 3091 views
  • 4 likes
  • 6 in conversation