- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
My Apologies, it didn't work. It has only fieldname and fieldvalue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Try it again, the last part of the code got deleted for some reason. I added it back in.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Pandu2 wrote:
Actually when a new batchNo comes that's the sign of previous BatchNo group ends. That's how I figured out after doing some analysis how the group ends, otherwise our business and I doesn't know how it ends cuz the complexity of data and not following any specific pattern.
That's why the parenthesis are important. They delimit the batches and lines.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Here's the original format of my json data:
{ """BatchNo"":""001"""" "Keys": [ { """Goodsname"":""Nikeshoes"""" """Quantity"":""3"""" """Infotype"":""Sneakers"""" } { """Goodsname"":""pants"""" """Quantity"":""5"""" """Infotype"":""Trackpants"""" """Newly"":"""""" """Infotype"":""RAQ"""" """TypeId"":""109"""" """Cause"":""Broken"""" """Quantity"":""0"""" } }{ """BatchNo"":""009"""" "Keys":[ { """Goodsname"":""Nikeshoes"""" """Quantity"":""3"""" """Infotype"":""Sneakers"""" }{ """Goodsname"":""pants"""" """Quantity"":""5"""" """Infotype"":""Trackpants"""" } ] } { """BatchNo"":""011"""" "Keys":[ { """Goodsname"":""Jackets"""" """Quantity"":""3"""" """Infotype"":""topwears"""" } """Newly"":"""""" """Infotype"":""RAQ"""" """TypeId"":""100"""" """Cause"":""Broken"""" """Quantity"":""0"""" ] }
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks @Pandu2 for posting the original json. It is not a well formed json and there is no uniformity between the different records.
For example, for BatchNo 001 there is no closing square bracket '.]' .
So whatever approach you are going to use, data cleaning preparation would consume time. If it is possible, make sure that data comes in a proper format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Pandu2 wrote:
Please I request you to help me on this.
Please post the complete log. It is impossible to debug something without knowing what happened actually.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Log:
NOTE: There were 3417992 observations read from the data set work.have.
NOTE: The data set work.want has 1 observations and 10 variables.
NOTE: Compressing data set work.want increased size by 100.00 percent.
Compressing is 2 pages; un- compressed would require 1 pages.
NOTE: DATA statement used(Total process time).
Only these set of lines I've it on my sas log.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Well, i wouldn't invest more time in my solution, but try to import the json file directly with libname statement. Have look at https://support.sas.com/resources/papers/proceedings17/0856-2017.pdf
The log has nothing of value, which means that something in the file is not as expected. Adding some put-statements could help, but i would postpone this, and give the more recent tools to handle json a chance.
- « Previous
-
- 1
- 2
- Next »