Variable format while importing data

Reply
Occasional Contributor
Posts: 9

Variable format while importing data

Hi,

 

Please find attached, I want to import 10-12 dataset in SAS Project with same variable formats and then append (add all obs) to create 1 single large dataset. 

 

Each time I import a file I have to define field attributes, can these be converted into a sort of template & applied which importing a new file. 

 

Am using SAS EG 6.1 (64bit) 

 

Thanks in Advance. 

Attachment
SAS Super FREQ
Posts: 8,720

Re: Variable format while importing data

Hi:

  If you want to continue to use point and click techniques, then there's not a lot of options when you are doing point and click, although you can copy tasks and make task templates, so those might be alternate ways to avoid having to do the format definition over and over.

 

  However, if you are willing to learn how to write programming code, then you would learn in the Programming 1 (free as e-learning) class how to write a program to import data into SAS. Once you have a program to read one dataset working correctly, then you only need to modify the program to read the other datasets. There are even ways to automate this process using the SAS Macro facility. However, depending on how you need to work and what you're willing to learn, impacts the answer to your question.

 

  SAS Programming 1 can be activated by going here and clicking START on the self-paced e-learnining offering of the class: https://support.sas.com/edu/schedules.html?ctry=us&crs=PROG1

 

cynthia

Occasional Contributor
Posts: 9

Re: Variable format while importing data

Thank you, Cynthia.

Super User
Super User
Posts: 6,351

Re: Variable format while importing data

Note: If you want to attach a picture in this forum use the insert image icon instead of attaching it as a file. That way it is visible in the message.

 

If you want to control the format of the data set generate from a text file then use a program to read the file instead of using PROC IMPORT.  Proc Import has to guess at what the files contain.

Occasional Contributor
Posts: 9

Re: Variable format while importing data

Thank you, Tom.

Ask a Question
Discussion stats
  • 4 replies
  • 103 views
  • 2 likes
  • 3 in conversation