BookmarkSubscribeRSS Feed
Chris_M
Calcite | Level 5

Some of the information that we use is being moved from oracle tables to web services.  We accessed the oracle tables through servers>local>libraries that were set up with code that was run when we started SAS.  We are using EG version 7.3.

 

At this point I am only trying to set up a library for a list of account numbers and parcel numbers:

 

1 55425 16109110079
2 55426 16109110078
3 55427 16104413031
4 55464 16109501001
5 55465 16109501001

 

Running the following code will generate a data table and a report in the process flow. The first 5 lines of this table are above. (I am not a programmer and I have a partial understanding of what each step does. I put them together from examples and by trial and error) 

 

filename mymap temp;

filename resp temp;
filename hdrs temp;
filename parcels temp;
filename map temp;
 

data _null_;
infile datalines;
file mymap;
input;
put _infile_;
datalines;
{
  "DATASETS": [
    {
      "DSNAME": "sp_to_parcel",
      "TABLEPATH": "/root",
      "VARIABLES": [
        {
          "NAME": "ordinal_root",
          "TYPE": "ORDINAL",
          "PATH": "/root"
        },
        {

          "NAME": "ServicePoint",
          "TYPE": "CHARACTER",
          "PATH": "/root/ServicePoint"
        },
        {
          "NAME": "Parcel",
          "TYPE": "CHARACTER",
          "PATH": "/root/Parcel"
        }
      ]
    }
  ]
}
;
run;


proc http 

 url="https://isddev.blah.blah.com/SASWebServiceDemo/api/ServicePoint"
 method= "GET"
 out=resp;

headers
   "Authorization"="Bearer xxxxxx";

 run;

 libname parcels JSON fileref='resp' map=mymap;

data results_out;
set parcels.sp_to_parcel;
run;
proc datasets library=parcels; run;


If I add the code up to the libname statement into the code that runs when I start SAS it will create an entry for Library>Parcels> SP_TO_PARCEL but when I click on it I get the error "Source array was not long enough. Check srcindex and length, and the array's lower bounds"

 

Thanks in advance for your help

 

Chris

 

eg error message (2).png

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 0 replies
  • 624 views
  • 0 likes
  • 1 in conversation