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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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