Has anyone written a macro/guide to automatically download specified vectors from Statistics Canada?
Suppose I want, as an example, v125190 v125221, is there a way to automate this? Note these are vectors with data and not tables.
Thx
How do you access it now? Does it have a URL? Some other method?
I would go to this page and get a CSV
1. https://www150.statcan.gc.ca/t1/tbl1/en/sbv.action#tables
2. Where it says enter vector numbers enter them in separated by commas, then choose 3,000 as the number of reference periods, then download manually
3. Load into SAS.
This is not an automated approach....so I thought I would ask
So clicking around it looks like you can download a ZIP file with the data for one of those directly.
https://www150.statcan.gc.ca/n1/en/tbl/csv/24100041-eng.zip
Not sure whether it is always going to use that 24100041 number for this "vector".
The ZIP file has two files. From the names it looks like one is the data and the other is the description of the data.
I wrote a macro to get all data at one point, not specific vectors.
It's in the Canadian subforum.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.