BookmarkSubscribeRSS Feed
kaverisonu
Calcite | Level 5

I have a SAS dataset,It has almost 2000 variables,when exported from sas the names of the all the variables are not imported,though values of all the variables are imported. Any help.

 

 

7 REPLIES 7
PeterClemmensen
Tourmaline | Level 20

I need more information than this. From where are you importing your data and to where are you exporting? Show us some code 🙂

kaverisonu
Calcite | Level 5

The data was imported into SAS in csv form and after doing some calculation and variable creation,i am trying to export the dataset 

from SAS on the same server where sas is installed.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Read the guidance on the post a question below the post button.  We cannot see your screen or what you are doing so cannot help.

I guess that you are importing data from Excel (as no-one seems to use good file formats any more) and using proc import.  Now in Excel you can have any old nonsense, you can even have pictures an other things.  SAS requires the data to be standardised into a good structure and has limits on what variable names can be.  Its likely that because the "variable names" you state are not valid, then they are changed to something which is valid, often colX.  A robust import process would consist of getting the data into a fixed file format (CSV for instance) then writing a datastep to import that fixed file giving the structure and read commands as you know the data should be.

Try posting a proc contents of the data imported and showing what your issue is.

Kurt_Bremser
Super User

@kaverisonu wrote:

I have a SAS dataset,It has almost 2000 variables,when exported from sas the names of the all the variables are not imported,though values of all the variables are imported. Any help.

 

 


Please rephrase your question

Are you exporting or importing?

If exporting, provide the export code; providing example data (see https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...) may be helpful; since you mention that no names at all are ex(im?)ported, just a few variables will suffice.

kaverisonu
Calcite | Level 5

ohh yes..typo..i am trying to export.I am trying to export graphically,not using proc export

Ksharp
Super User

proc export datafile='....' out=....   dbms=csv replace;

putnames=yes;

run;

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
  • 7 replies
  • 1507 views
  • 0 likes
  • 5 in conversation