BookmarkSubscribeRSS Feed
Sukesh33
Calcite | Level 5

Hi,

We have to import an input json file on a daily basis that has below structure,

{

   "/profile/users":[

     {"id":"001","name":"Sam"},

     {"id":"002","name":"Dav"}

   ],

 "/profile/usernames":[

   {"id":"001","usrnm":"sam123"},

   {"id":"002","usrnm":"dav009"}

  ]

}

 

I am trying to create a map file to parse the above json, but i was not able to specify path for above users and user names array as that have "/" in them.

 

{
"DATASETS": [
{
"DSNAME": "users",
"TABLEPATH": "/root/profile/users",
"VARIABLES": [
       {
         "NAME": "id",
         "TYPE": "NUMERIC",
         "PATH": "/root/profile/users/id"
       }

                        ]

}

]}

 

I am not able to import any data due to the table path. I am able to import and see data when I change the array name as /profile/users -> /profile_users and update path as /root/profile/users/id -> /root/profile_users/id.

 

How do i read the file as is, sincei will not be able to change it on a daily basis

 

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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