- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I tried to use STIMERw. and TIMEw. informats but am getting error
Kindly go through the attached doc for the refff.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Post test data and code as text in the code window ({i} above the post or the SAS symbol), this isn't a game of picture hunt!
As for your first question, I know of no format called stimer, which is probably why it isn't recognised. Unless its a very new one its invalid, so where did you get the idea that it was?
The timeX.D variable should work, although what do you expect from length 7?
Time5. = HH:MM
Time8. = HH:MM:SS
As for the last picture I have no idea what you mean.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@mrinmoywhen hunting for a suitable informat, use the format hunter - as described in paper at http://support.sas.com/resources/papers/proceedings14/1744-2014.pdf
%LET string= 23:45.0 ; * test this ; %LET require= "0:23:45"t ; * result wanted ; DATA time_test ; RETAIN string "&string" /* value to be tested */ Want1 &require /* result wanted */ ; SET sashelp.vformat ; * list of all formats ; WHERE fmtType = 'I' ; * only INFORMAT rows ; WHERE ALSO fmtName ne: '$' ; * not character formats; inValue = INPUTN( string, fmtName, length(string) ) ; * perform test ; if _error_ then do; _error_ = 0 ; * avoiding variable dump in the SAS log ; Delete ; End ; if invalue = want1 ; * now check value returned ; PUT "&string " inValue= invalue dateTime. +1 fmtname= ; RUN ;
The results indicate success for hhmmss. as well as stimer. So if your SAS release doesn't support informat stimer. you might have success with informat HHMMSS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Which SAS version are you using? The STIMER informat has been around since at least 9.2:
data test;
input timeval :stimer8.;
format timeval time8.;
cards;
22
22:23
15:23:27
;
run;
proc print data=test noobs;
run;
Result:
timeval 0:00:22 0:22:23 15:23:27
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
data X;
infile " file location .dat";
input canoe $ @ 'school:' school $ @ 'time:' racetime :time7.;
run;
Kindly have a look at the attach fiel for the log out put
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Please post the contents of your text file as text (copy/paste to a {i} subwindow). I'm not typing test data manually from a picture.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ mrinmoy
I see you are using WPS
That might explain the absence of the STIMER informat
If the HHMMSS informat doesn't work either, you might need to speak to the producers of WPS to see if they can add these informats, or provide you the support you need in some other way
all the best