BookmarkSubscribeRSS Feed
Tucky
Obsidian | Level 7

Hey guys,

 

I have having trouble finding a solution for a problem I have having with a very large single line feed comma delimited text file.

 

I have tried termstr, and several of the solutions for similar issued here and on other boards.I don't think it has carriage returns, just one long string with commas.

 

It has 37 variables, and I have managed to parse the these out using prx. However, getting the rest is proving difficult.

 

It was generated from Clementine. I've asked for another version pipe delimited / csv however that might take some time.

 

What I need help with is a loop that go until the end of string (2.3 GB) that  

infiles every 37 sets of delimiters in a ob then I can parse

or

infile each delimter times 37 and after 37 create new observaiton, then repeat until end of string.

 

 Any help would be much apprechiated.

 

Michael

 

 

 

 

 

 

2 REPLIES 2
Tom
Super User Tom
Super User

Just use RECFM=N.

 

data want ;
   infile 'myfile' dsd dlm=',' recfm=n;
   input var1-var37 ;
run;
Tucky
Obsidian | Level 7

Thank Tom, I didn't know it would be that simple.

 

Is there a way to limit obs out so I can test it? FIRSTOBS / OBS are not suitable as it reads it as one line in.

 

I am unfamilar with this part of the data step. I have tried a small loop, but does the input hit the PVD as one iteration?

 

data want;

infile oneline dsd dlm=',' recfm=n;

n=0;

do until (N>=5);

input var1-var37 $;

N+1;

end;

run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 963 views
  • 1 like
  • 2 in conversation