BookmarkSubscribeRSS Feed
Bhavanaa44
Fluorite | Level 6
Data consists of subject Id by visit and date so how to identify wrong date by program. As after visit 1 is date of enrollment. And I have given only 1 subject details if there are more then how to identify discrepancy error.

Subjid sex age visit date
101 M. 25. 1. 30-05-2016
101. M. 25. 2. 29-06- 2016
101. M. 25. 3. 25-07-2016
101. M. 25. 4. 26-02-2016
101. M. 25. 5. 25-08-2016

3 REPLIES 3
Shmuel
Garnet | Level 18

I understand that the date is given in a char type variable, in a format of ddmmyy10.;

While converting the date into num type you ususlly use the ddmmyy10. informat, or any other informat.

 

You can code: num_date = input(char_date, <informat>, ??);

in case of date error you will get missing value.

check the num_date is it missing or not.

Cynthia_sas
SAS Super FREQ
Hi:
Some questions:
1) Why is there a period (.) after every value except the first row? There's no period after 101 in the first row. Is this intentional? A typo? Does it mean something?
2) How do you identify a discrepancy? Of the above 5 rows, where is the discrepancy and what it your logic?
3) You said "As after visit 1 is date of enrollment" -- that doesn't make sense to me -- there are 4 rows after visit 1 does that mean there are 4 dates of enrollment? I would have expected visit 1 to be the date of enrollment AND the date of the first visit and that for every other visit, the date just represents the visit date? I don't understand how you can define that "after visit 1 is date of enrollment".

What code have you tried? What is your desired output?

Cynthia
Kurt_Bremser
Super User

Converting the dataset to a data step and posting the resulting code here in the proper way (see my footnotes for both of these steps) will remove any ambiguity about your data and let us use it for testing. Additionally, post an example for how your datset should look like after processing.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 3 replies
  • 737 views
  • 0 likes
  • 4 in conversation