Hi everyone,
I have the JSON file and I need to convert this JSON file, that is in text format, into a SAS dataset. Attached is the example JSON text file. Any help or suggestion is appreciated.
Schema in the table:
_id
barcode
brandCode
category
categoryCode
cpg
topBrand
name
Sample:
{"_id":{"$oid":"601ac115be37ce2ead437551"},"barcode":"511111019862","category":"Baking","categoryCode":"BAKING","cpg":{"$id":{"$oid":"601ac114be37ce2ead437550"},"$ref":"Cogs"},"name":"test brand @1612366101024","topBrand":false}
{"_id:{"$oid":"601c5460be37ce2ead43755f"},"barcode":"511111519928","brandCode":"STARBUCKS","category":"Beverages","categoryCode":"BEVERAGES","cpg":{"$id":{"$oid":"5332f5fbe4b03c9a25efd0ba"},"$ref":"Cogs"},"name":"Starbucks","topBrand":false}
Thanks for the reply. I read that article earlier and got error while trying to run it myself. I guess I wasn't understanding the "proc http
url= "&fullurl.", in this case will I need to save the file in a web path? My file is saved as txt on the desktop.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.