BookmarkSubscribeRSS Feed
UrvishShah
Fluorite | Level 6

Hi All,

I am trying to read data from one of the following link

https://in.finance.yahoo.com/q?s=%5EHSI&ql=1


I can create HTML page by using proc http...


But can anyone suggest how to read the data directly from the above link...Please note that data is not saved in file format...It is just displayed in link and i want to read from that...


Thanks in advance...


-Urvish

5 REPLIES 5
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

What exactly are you trying to read from that page.  It looks like a straight forward HTML document (right click and view source).  If its something specific then you need to read it in as text and identify the elements you want to pull out, i.e. look for

"HANG SENG INDEX (^HSI)"

In the read in text, and then read and parse from there.

RamKumar
Fluorite | Level 6

In the interst of time, may I ask how to read and parse "HANG SENG INDEX (^HSI)" from the given URL?

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well, you mention that you have: "I can create HTML page by using proc http..."

So you then just need to do a datastep with an infile.  Read the whole text file in and using findc() or index() search for the data you are after.  Once you know where it is then you parse the HTML tags to get the actual data.

Ksharp
Super User

You are connecting a encrypt URL . Check proc http documentation

Making PROC HTTP Calls by Using the HTTPS Protocol
In order to make PROC HTTP calls by using the HTTPS protocol, you must configure
a trust source that contains the certificate of the service to be trusted. This trust source
and its password must be provided for the SAS session by setting Java system options
using jreoptions. You can provide this information on the SAS command line or in a
SAS configuration file. Use the following syntax. Be sure to enter the following entry on
one line:
-jreoptions (-Djavax.net.ssl.trustStore=full-path-to-the-trust-store -
Djavax.net.ssl.trustStorePassword=trustStorePassword)
The following example shows how to use the entry on the SAS command line. This
example uses the Windows operating environment. Be sure to enter the following entry
on one line:
"C:\Program Files\SAS\SASFoundation\9.2\sas.exe" -CONFIG
"C:\Program Files\SAS\SASFoundation\9.2\nls\en\SASV9.CFG"
-jreoptions (- Djavax.net.ssl.trustStore=C:\Documents and Settings\mydir\.keystore
-Djavax.net.ssl.trustStorePassword=trustpassword)


Xia Keshan

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 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
  • 5 replies
  • 1864 views
  • 0 likes
  • 5 in conversation