Hey everyone!
I'm a new user working on an assignment and was curious as to whether we can convert the informat yyq6. (Ex: 2017Q1) to mmddyy10. So 2017Q1 would be converted to 1/1/2017 and 2017Q2 would be converted to 4/1/2017, the start of the second quarter of 2017, and so on. Any pointers appreciated. Thank you!
Informats read data and depend on the text read. The formats that read intervals like YYQ will generally take on the first calendar date of the interval as SAS date values must have a day of the month. So the informat process implies the first day of the period involved.
Formats, which display the values, can be changed any time you want. There may be a default format assigned such as YYQ1 but any procedure you want you can change that.
You may need to change actual data depending on your values. A format like YYQ displays 3 months worth of dates as the same formatted value and could have many, as in any specific date of the year during the quarter, values in your data.
I suggest that you try printing your data with Proc Print and add a statement like : Format nameofyourdatevariable mmddyy10. ;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.