BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BingL
Obsidian | Level 7

Hello to whomever can help me

 

Please see the attachment. I copy and paste exactly the coed from SAS user Guide. Of course I change the APIKey with my own. But I get error. 

 

I can't do nothing about it. I can't learn anything from SAS/ERS 14.1 user Guide, because I can't even retrieve the data with SAS.

 

Please help

 

Thank you!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

From the manual - use the option that doesn't require an environmental value, if you're not familiar with them. 

 

There's an example that explains how to use libname without environmental variables:

 

The XML data that the Quandl website returns are placed in a file that is named by the OUTXML= option—in this case, OILTD1.xml. Note that the SASEQUAN engine appends a numeral to the XML filename, and the file extension (.xml) is excluded from the filename that appears in the OUTXML= option. This XML data file resides in the location that is given inside the string enclosed in double quotation marks in the SASEQUAN LIBNAME statement. So, in the preceding example, if the QUANDL environment variable is set to 

   C:\quandata\

then the downloaded XML file is located at 

   C:\quandata\OILTD1.xml

An equivalent LIBNAME statement that does not use any environment variables could be as follows: 

   libname quan sasequan "C:\quandata\"
      OUTXML=oiltd
      XMLMAP="C:\quandata\oiltd.map"
      APIKEY='XXXXXXXXXXXXXXXXXXXX'
      IDLIST='NSE/OIL' 

 

http://support.sas.com/documentation/cdl/en/etsug/68148/HTML/default/viewer.htm#etsug_sasequan_getti...

View solution in original post

10 REPLIES 10
mohamed_zaki
Barite | Level 11

Did you created a Windows system environment variable "QUANDL" ?

Read the notes in : 

http://support.sas.com/documentation/onlinedoc/ets/ex_code/141/quanex03.html

 

Based on your log you did not......

 

Capture.PNG

 

So what you need to do as in the notes is: "define a Windows system environment variable ,QUANDL, to the path of your writeable folder containing the **********.MAP file and **********.xml."

 

How to set the path and environment variables in Windows

 

Because this is what %SYSGET Function is try to retrieve

BingL
Obsidian | Level 7

Yes

That "Quandl" is a library I created

BingL
Obsidian | Level 7

So What should I do in order to correctly execute the code?

BingL
Obsidian | Level 7

Hello Zaki

 

How what shoud I put in the VALUE field when I define my Windows system environment variable?

Reeza
Super User

From the manual - use the option that doesn't require an environmental value, if you're not familiar with them. 

 

There's an example that explains how to use libname without environmental variables:

 

The XML data that the Quandl website returns are placed in a file that is named by the OUTXML= option—in this case, OILTD1.xml. Note that the SASEQUAN engine appends a numeral to the XML filename, and the file extension (.xml) is excluded from the filename that appears in the OUTXML= option. This XML data file resides in the location that is given inside the string enclosed in double quotation marks in the SASEQUAN LIBNAME statement. So, in the preceding example, if the QUANDL environment variable is set to 

   C:\quandata\

then the downloaded XML file is located at 

   C:\quandata\OILTD1.xml

An equivalent LIBNAME statement that does not use any environment variables could be as follows: 

   libname quan sasequan "C:\quandata\"
      OUTXML=oiltd
      XMLMAP="C:\quandata\oiltd.map"
      APIKEY='XXXXXXXXXXXXXXXXXXXX'
      IDLIST='NSE/OIL' 

 

http://support.sas.com/documentation/cdl/en/etsug/68148/HTML/default/viewer.htm#etsug_sasequan_getti...

BingL
Obsidian | Level 7

Hello Reeza

 

It WORKS!

 

Thank you!!

BingL
Obsidian | Level 7

Hello Reeza 

 

Can I have a question for you?

 

Now I know how to run that program with pasting direct path in the double quote " ".

 

So how can I set up that macro feature "%sysget(QUANDL)"?

 

I tried to set it up as following steps: 

       in the Variable field I put  QUANDL

       in the Value field I put C:\Users\Hello\Documents\My SAS Files\9.4\Quandl

then I hit OK

 

but it didn't work when I run the code from the SAS Manual.

 

So what am I missing?

 

Thank you.

Reeza
Super User

The instructions from @mohamed_zaki about setting up a system variable.  

 

If you're sure you set it up correctly you should post a screenshot as well as your code that shows it not working. You may need to restart your computer/SAS for the system variable to be available. 

 

BingL
Obsidian | Level 7

Thank you Reeza.

It works. SAS can access to that directory.

 

New I have another problem. Please see the attachment.

 

when i run the code for the first time it gave me that output. and all the files were saved in Quandl library

 

but when I tried to run that data step, in the blue highlight, the second time, it gave me an error message because the name of the Total Trade Quantity is not valid sas name.

 

so what should I do?

 

Thank you.

 

 

Reeza
Super User

This question is closed, please create a new thread if you have more questions. 

Also, your images are small, please make them larger when you upload them.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 10 replies
  • 1936 views
  • 3 likes
  • 3 in conversation