For the last week I have been using SAS VA for visualization purposes. Now I am hoping to convert strings expressed in ISO8601 interval format, such as "-PT20M" and "PT24H", to time (preferable) or numeric format so that "-PT20M" would be -00:20:00 in time format or just -20 in numeric format and respectively "PT24H" would be 24:00:00 or 24. Answers presented here are only applicable to base SAS situations.
I am starting to wonder whether I have to implement some sort of IF ELSE fix...I hope not...
Thank you for your answers in advance.
There is a section for ISO formats.
Hello @RW9 and thank you for your swift reply!
I'm afraid that I have already looked into that page and found it useless because firstly it doesn't provide information about their usage and secondly because SAS VA only seems to support four formats for strings (uppercasing, putting the string in double quotes, taking it raw "$w.d" and a fourth I can't remember at the moment.
You should convert these duration values before loading the data to be used by Visual Analytics, since there are no operators within VA to handle this.
Find below an example on how to convert an ISO duration value into a SAS time value.
input iso8601_int : $32.;
length newtime 8;
call is8601_convert("du", "du", iso8601_int, newtime);
format newtime time.;
The $N8601B. informat converts a duration into a character representation, that later can be used with the CALL IS8601_CONVERT routine.
See also this paper https://www.pharmasug.org/proceedings/2012/DS/PharmaSUG-2012-DS22-SAS.pdf for additional information
Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.
Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.