BookmarkSubscribeRSS Feed
fatemeh
Quartz | Level 8
Big DATA Imports[ New ]
 

data alaki;
   do trt = -1 to 1 by 2;
     do gene = -1 to 1 by 1;
       do time=1 to 3;
          input responder@;
          output;
       end;
     end;
   end;
datalines;
4.22027067    4.37189508    4.42832633    
12.342489    12.3535905    12.2709339    
6.10929307    6.34392243    6.43155656    
4.43362232    4.54115629    4.2886178
12.6404601    12.715388    12.7065314
6.07044046    6.06052994    6.11873577
;
run;
proc print;run;

 

hello.my question is how i can read my data as a seperate sas dataset in the above program,and then use set statement to read from this new dataset instead of using datalines ,because my data is big data and i can not place it in datalies .i used proc import but it gives me header ,and considers it as  columns which do loop doesn't realize it .if anybody knows the answer we appreciate to share it.

 

thanks

8 REPLIES 8
fatemeh
Quartz | Level 8

data alaki;
   do trt = -1 to 1 by 2;
     do gene = -1 to 1 by 1;
       do time=1 to 3;
          input responder@;
          output;
       end;
     end;
   end;
datalines;
4.22027067    4.37189508    4.42832633    
12.342489    12.3535905    12.2709339    
6.10929307    6.34392243    6.43155656    
4.43362232    4.54115629    4.2886178
12.6404601    12.715388    12.7065314
6.07044046    6.06052994    6.11873577
;
run;
proc print;run;

 

hello.my question is how i can read my data i aseperate sas dataset .and then use set statement to read from this new dataset instead of using datalines ,because my data is big data and i can not place it in datalies .i used proc import but it gives me header .

 

thanks

andreas_lds
Jade | Level 19

Interesting strategy: repeating a question while ignoring answers already given.

 

A data-step can import almost any text-file. Multiple datasets are created by using the output statement.

Oligolas
Barite | Level 11

Probably something like that should work:

 

PROC IMPORT OUT= WORK.tmp 
            DATAFILE= "C:\Users\FATEMEH\Desktop\research project\alak.xlsx" 
            DBMS=EXCEL REPLACE;
     SHEET="Please complete"; 
     GETNAMES=YES;
     MIXED=YES;
     SCANTEXT=NO;
     USEDATE=NO;
     SCANTIME=NO;
RUN;

Reading the documentation about how to import and handle data might help too.

 

Cheers

________________________

- Cheers -

ballardw
Super User

You might post a few lines of data as text and show what the result should be. If your data is sensitive then something with the same properties. Use a codebox opened with the forum {i} menu icon so the text does not get reformatted by posting in the main message window.

 

Does your actual data not have values for the trt, gene and time and you have to assign them based on the row in the data???

Reeza
Super User

What's your definition of big?

What's the source?

 

You can read from a file using an INFILE staement to point at a text file, or a straight PROC IMPORT will often work as well. Without further detailed information we can't help you.

fatemeh
Quartz | Level 8

hi. my data has hundred thousands rows ,i use small data to understand . when i use proc import the sas output gives me the data set with headers that looks like thistable.

Capture1.JPG

i am trying to use this below program but it does not give me the numbers in the table as responder.

 

data alaki;
infile'C:\Users\FATEMEH\Desktop\research project\alak.xlsx' ;
   do trt = -1 to 1 by 2;
     do gene = -1 to 1 by 1;
       do time=1 to 3;
          input responder;
          output;
       end;
     end;
   end;

run;
proc print data=alaki;run;

 

Reeza
Super User

You need to first import your data (PROC IMPORT)

THen you need to add the multiple options, since your code is replicating your data or assuming a structure. Either way, move that to a different data step. If your code works on your small sample it will work on hte big data (thanks SAS) so working with small samples to start is a very smart idea. 

 

Here's some video tutorials on SAS and the UCLA link above has many many tutorials on everything from reading sas to how to interpret your regression analysis output.

http://video.sas.com/#category/videos/how-to-tutorials

ChrisNZ
Tourmaline | Level 20

Read the documentation.

Proc import has options DATAROW and GETNAMES to deal with headers.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 8 replies
  • 1096 views
  • 0 likes
  • 6 in conversation