- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a dataset with multiple timepoints in each observation (eg. lbtim1 lbtim2 lbtim3...). They are all in time5. numeric format.
How can I change all of these to character format (TOD5.)?
All of the time variables have the same prefix 'lbtim' with the timepoint. Here is what I started with:
data prsupp;
set db.lbi;
array timn (*) lbitim:;
array timc (*) lbtimc:;
do i= 1 to dim (timn);
if ~missing (timn(i)) then timc(i)=put(timn(i),tod5.);
end;
run;
I guess it's something with the new character variables I'm trying to create. Or can I just overwrite the numeric variables to character somehow?
Help is appreciated!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Why do you need to convert your time variables to character? You can assign the TOD5. format to them without converting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
array timc (*) lbtimc:; This is a new assignment, so if i am right, you can't use var lists
rather array timc (count of lbtimb)
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Why do you need to convert your time variables to character? You can assign the TOD5. format to them without converting.