BookmarkSubscribeRSS Feed
Kurt_Bremser
Super User

What you posted earlier is what you think is in the dataset, not what is in the file. Open the file with a text editor and copy a few lines into a code box. I will not repeat this a third time.

Pandu2
Obsidian | Level 7
Didn't I say it's not in my control. It was on the server side I've got no access for that
Kurt_Bremser
Super User

If you don't have access to it, you can't read it. If you can read it from SAS, you can download it to your desktop, either with SAS Studio or the Copy Files task in Enterprise Guide.

Pandu2
Obsidian | Level 7
I posted the data which has one column and I need the final dataset which should have 3 columns
ballardw
Super User

@Pandu2 wrote:
I posted the data which has one column and I need the final dataset which should have 3 columns

Please show how in your original post of :

I've a temp dataset whose structure is like below
sno name.
1 "Xyz":"123"
2 "gef":"abc23"
3 "rod":"124899"
4. "Xyz":"567"
5. "gef":"ijk67"
6. "rod":"800775"

is "one column".

That post implies 2 "columns". You explicitly labeled them as SNO and NAME.

Tom
Super User Tom
Super User

@Pandu2 wrote:
Sure,
Data work.want
Infile srct dad lrecl=30000000 dlm ='[{}}';
Input js : $2000.@@;
do i =1 to countw(js, ' , ');
name =scan(js,i, ' , ');
Output;
end;
drop js i ;
run;

So, it creates a temp dataset and has multiple observations but I kept few only. Please have a look at the data which I posted above.

This is the most useful posting you have made in this thread.  From these we can see a lot of the information you have not been explaining before.

  • You are reading a TEXT file and not a DATASET
  • The file is probably a JSON file, so you should try to read it with the JSON libref engine instead of trying to parse it yourself.
  • You do have access to the file so that you can show us what it looks like.

Use a simple DATA step to dump a couple of lines from the file into the SAS log.

data _null_;
  infile srct obs=3;
  input;
  list;
run;

If the lines in the file are really 3Million bytes long then you might not what to list more than 1 of them.  You might want to just list the first few hundred bytes from the file instead.

data _null_;
  infile srct obs=5 recfm=f lrecl=100;
  input;
  list;
run;

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

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 21 replies
  • 2588 views
  • 0 likes
  • 6 in conversation