BookmarkSubscribeRSS Feed
Pandu2
Obsidian | Level 7

My Apologies, it didn't work. It has only fieldname and fieldvalue.

Reeza
Super User

Try it again, the last part of the code got deleted for some reason. I added it back in.

Reeza
Super User

@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. 

Pandu2
Obsidian | Level 7
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"""" ] }
Sajid01
Meteorite | Level 14

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. 

Pandu2
Obsidian | Level 7
I just posted how the way it looks like and I kinda agree with you that it doesn't follow a specific pattern.
andreas_lds
Jade | Level 19

@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.

Pandu2
Obsidian | Level 7

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.

andreas_lds
Jade | Level 19

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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 23 replies
  • 1232 views
  • 8 likes
  • 5 in conversation