- #1
- 7,347
- 11,312
Hi All,
Trying to get basics of inputting data into SAS ( University Version, i.e. in remote Virtual Directory in SAS Studio . I hope my layout , nor my general writing are too confusing. Feel free to suggest a different format):
Please critique:
We want to read file 'FileName' into SAS for some processing
1) To input/import data when 'FileName' is _not_ in SAS in non-permanent form , i.e., to be stored in 'Work' directory and will disappear after session is over.:
--------------------------------------------
1.1) DATA [FileName1] ;( Original File name [FileName] modified nto , e.g. FileName1)
1.2) INFILE [Pathname for FileName];
1.3) INPUT [Field1] [Field2]...[Fieldn]; : These are the fields/columns from [FileName] we want to import
1.4) RUN;
Data will be read into temporary file within 'Works' folder in Virtual Drive. File will disappear once session is closed.
----------------------------------------------
2) To store data file [FileName] permanently in SAS in Folder [Folder]. We use a 'LibName which is an alias for the name for the folder where we want to store things together with the pathname for the folder.:
2.1) LIBNAME [Alias for FileName] [ Pointer for or Pathname for [Folder] ];
2.2) SET [FileName, from step 1.1];
2.3) RUN ;
Is this correct?
Trying to get basics of inputting data into SAS ( University Version, i.e. in remote Virtual Directory in SAS Studio . I hope my layout , nor my general writing are too confusing. Feel free to suggest a different format):
Please critique:
We want to read file 'FileName' into SAS for some processing
1) To input/import data when 'FileName' is _not_ in SAS in non-permanent form , i.e., to be stored in 'Work' directory and will disappear after session is over.:
--------------------------------------------
1.1) DATA [FileName1] ;( Original File name [FileName] modified nto , e.g. FileName1)
1.2) INFILE [Pathname for FileName];
1.3) INPUT [Field1] [Field2]...[Fieldn]; : These are the fields/columns from [FileName] we want to import
1.4) RUN;
Data will be read into temporary file within 'Works' folder in Virtual Drive. File will disappear once session is closed.
----------------------------------------------
2) To store data file [FileName] permanently in SAS in Folder [Folder]. We use a 'LibName which is an alias for the name for the folder where we want to store things together with the pathname for the folder.:
2.1) LIBNAME [Alias for FileName] [ Pointer for or Pathname for [Folder] ];
2.2) SET [FileName, from step 1.1];
2.3) RUN ;
Is this correct?