Desktop productivity for business analysts and programmers

USING sas enterprise guide version 7.12

Reply
Occasional Contributor
Posts: 10

USING sas enterprise guide version 7.12

Hello,

I have SAS enterprise guide verison 7.12 installed and server is connected. I need to use comma delimited txt file from SASapp using the server directory. I could access that txt file in server.  In order to use that txt file, do I need to use infile, input and datalines option? How do I proceed to use data and proc step?

 

Thank you for your help in advance

Samrita

Super User
Posts: 7,412

Re: USING sas enterprise guide version 7.12

Datalines is for inline data (data is written into the data step). For an external file, use infile and input.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 10

Re: USING sas enterprise guide version 7.12

Thank you for reply,

data is under this file suppTRP-1062.txt and data looks like follows:

J,08,2,1,02/08/1998,74,280

J,11,1,,12/14/1997, 66, 169

 

so if I want to create new data SET called STUDY  using this file, can I use this code,

data work.suppTRP-1062;

   SET STUDY;

lenght Site $1 PT $2

Datalines;

J,08,2,1,02/08/1998,74,280

J,11,1,,12/14/1997, 66, 169

;

RUN;

 

Regards,

Samrita

 

 

Super User
Posts: 7,412

Re: USING sas enterprise guide version 7.12

You seem to not have read my post. You either use datalines and data internal to the data step, or infile and an external file.

 

In the data statement, you name the dataset that is to be created. A set statement names an existing dataset thst us to be read, so you don't need that statement. Use input to read variables.

 

Study the documentation for all these statements to get a clue.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Valued Guide
Posts: 505

Re: USING sas enterprise guide version 7.12

If you use the 'old text editor'  and the csv file is at c:\temp\tmp.csv

 

Then this code will create class.sas7bdat from the csv

 

dm "dimport 'c:\temp\tmp.csv' class  replace";

 

You can also type

 

dimport 'c:\temp\tmp.csv' class  replace

 

on the clean 'command line'

 

This does not work in EE, EG, UE, SAS Stiudio, On demand,.

 

EE does not have a command line that supports SAS scripting like home, cursor or store.

Ask a Question
Discussion stats
  • 4 replies
  • 143 views
  • 0 likes
  • 3 in conversation