DATA Step, Macro, Functions and more

Variable Names missing when file exported from sas

Reply
New Contributor
Posts: 4

Variable Names missing when file exported from sas

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.

 

 

PROC Star
Posts: 765

Re: Variable Names missing when file exported from sas

Posted in reply to kaverisonu

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

New Contributor
Posts: 4

Re: Variable Names missing when file exported from sas

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.

Super User
Super User
Posts: 7,988

Re: Variable Names missing when file exported from sas

Posted in reply to kaverisonu

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.

Super User
Posts: 7,854

Re: Variable Names missing when file exported from sas

Posted in reply to kaverisonu

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
New Contributor
Posts: 4

Re: Variable Names missing when file exported from sas

Posted in reply to KurtBremser

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

Super User
Posts: 7,854

Re: Variable Names missing when file exported from sas

Posted in reply to kaverisonu

Are you using Enterprise Guide?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 10,044

Re: Variable Names missing when file exported from sas

Posted in reply to kaverisonu

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

putnames=yes;

run;

Ask a Question
Discussion stats
  • 7 replies
  • 129 views
  • 0 likes
  • 5 in conversation