BookmarkSubscribeRSS Feed
mvk_sas
Calcite | Level 5

Hi All,

Question  A

I have situation where i need convert the SAS datasets into the flat files irrespective how many varaiables or how much data it has . ( i am trying out in such a way that if i give dataset name it should convert the data into flat file)

"One observation should be read as single like example i am going to assign varchar(3000)  so on."

Question  B

Coverting the flat file into the sas dataset even in this case also i am not about the size but should read the variables and coloums data.

Any help would really be apprciated .. I am trying out from end as well.

MVK

6 REPLIES 6
LinusH
Tourmaline | Level 20

I'm not sure about your requirements, but try to start with PROC EXPORT/IMPORT, and see if they can do what you need.

Data never sleeps
TomKari
Onyx | Level 15

Check out Chris' blog posting. Either you can use his Enterprise Guide task, or it may give you some ideas to do it yourself.

Tom

http://blogs.sas.com/content/sasdummy/2013/01/21/turn-your-data-set-into-a-data-step-program/

mvk_sas
Calcite | Level 5

Just for understanding this what i am looking at

mydataset has following observation in that.

First_name Last_name  Enumber

Mike          Dell               1234

when i read the data into flat file i want it this way

First_name,Last_name,Enumber

Mike,Dell,1234

This what i am looking for??

Any help on this is apprciated.

MVK

LinusH
Tourmaline | Level 20

PROC EXPORT!

Data never sleeps
TomKari
Onyx | Level 15

Yes, the format that you are showing is termed "csv", for comma-separated-values. This is easy do to with SAS. As Linus suggests, check out PROC EXPORT.

Tom

Peter_C
Rhodochrosite | Level 12

and if you don't like proc export

data _null_ ;

file 'your.csv' dsd lrecl=30000 ;

set your.data ;

put (_all_)(:) ;

run ;

Probably a good idea also to write the proc contents output data set into a matching csv

Then the reciever of the data has an idea about the datatypes.

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 6 replies
  • 1941 views
  • 0 likes
  • 4 in conversation