BookmarkSubscribeRSS Feed
BCNAV
Quartz | Level 8

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

 

 

4 REPLIES 4
Tom
Super User Tom
Super User

How do you access it now?  Does it have a URL? Some other method?

BCNAV
Quartz | Level 8

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

Tom
Super User Tom
Super User

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.

Reeza
Super User

I wrote a macro to get all data at one point, not specific vectors. 

It's in the Canadian subforum. 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1037 views
  • 0 likes
  • 3 in conversation