Building models with SAS Enterprise Miner, SAS Factory Miner, SAS Visual Data Mining and Machine Learning or just with programming

SASEQUAN Issue

Accepted Solution Solved
Reply
Contributor
Posts: 31
Accepted Solution

SASEQUAN Issue

[ Edited ]

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!

 


Accepted Solutions
Solution
‎01-24-2016 01:01 AM
Super User
Posts: 19,815

Re: SASEQUAN Issue

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


All Replies
Super Contributor
Posts: 490

Re: SASEQUAN Issue

[ Edited ]

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

Contributor
Posts: 31

Re: SASEQUAN Issue

Posted in reply to mohamed_zaki

Yes

That "Quandl" is a library I created

Contributor
Posts: 31

Re: SASEQUAN Issue

Posted in reply to mohamed_zaki

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

Contributor
Posts: 31

Re: SASEQUAN Issue

Posted in reply to mohamed_zaki

Hello Zaki

 

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

Solution
‎01-24-2016 01:01 AM
Super User
Posts: 19,815

Re: SASEQUAN Issue

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...

Contributor
Posts: 31

Re: SASEQUAN Issue

Hello Reeza

 

It WORKS!

 

Thank you!!

Contributor
Posts: 31

Re: SASEQUAN Issue

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.

Super User
Posts: 19,815

Re: SASEQUAN Issue

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. 

 

Contributor
Posts: 31

Re: SASEQUAN Issue

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.

 

 

Super User
Posts: 19,815

Re: SASEQUAN Issue

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.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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