Desktop productivity for business analysts and programmers

Encoding error using Datasets procedure

Reply
Occasional Contributor
Posts: 6

Encoding error using Datasets procedure

Hi everybody,

I have en encoding error in SAS Enterprise Guide 4.1.

When I try to create a dataset encoded in latin9 (it’s an exemple, but it’s the same for other encodings values), I can’t modify this dataset using the DATASETS procedure, even if I precise to access the table in encoding latin9.

Code

data class (encoding = latin9);

  set sashelp.class;

run;

proc datasets lib = work nolist;

  modify class (encoding = latin9);

quit;

Log

14         data class (encoding = latin9);

15           set sashelp.class;

16         run;

NOTE: Data file WORK.CLASS.DATA is in a format native to another host or the file encoding does not match the session encoding.

      Cross Environment Data Access will be used, which may require additional CPU resources and reduce performance.

NOTE: There were 19 observations read from the data set SASHELP.CLASS.

NOTE: The data set WORK.CLASS has 19 observations and 5 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.01 seconds

     

17        

18         proc datasets lib = work nolist;

19           modify class (encoding = latin9);

ERROR: File WORK.CLASS cannot be updated because its encoding does not match the session encoding or the file is in a format native

       to another host, such as HP_UX_64, RS_6000_AIX_64, SOLARIS_64, HP_IA64.

20         quit;

NOTE: Statements not processed because of errors noted above.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: PROCEDURE DATASETS used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

When I use encoding = wlatin1 or encoding = any in the DATASETS procedure, strangely it works, but I’m afraid it corrupts my dataset.

Code

proc datasets lib = work nolist;

  modify class (encoding = wlatin1);

quit;

Log

14         proc datasets lib = work nolist;

15           modify class (encoding = wlatin1);

16         quit;

NOTE: MODIFY was successful for WORK.CLASS.DATA.

NOTE: PROCEDURE DATASETS used (Total process time):

      real time           0.00 seconds

      cpu time            0.01 seconds

For information, the session encoding option is valued as latin1.

Can somebody explain me what’s wrong with using the same encoding as the one used to create the dataset ?

Thanks

Sincerely

Silbad

Community Manager
Posts: 2,707

Encoding error using Datasets procedure

I think that in this case, the processing is going through CEDA (Cross Environment Data Access), because the encoding is not "native" to the SAS session in which you are running.  Learn more about CEDA and how it works here:

http://blogs.sas.com/content/sasdummy/2010/05/24/finding-the-foreigners-in-your-sas-environment/

Chris

Occasional Contributor
Posts: 6

Re: Encoding error using Datasets procedure

Thank you Chris.

I found this in the SAS Documentation :

CEDA does not support update processing for any SAS files. 

Actually, I can modify my dataset with the DATASETS procedure, but only if I use the same encoding as the one defined in the session (here 'latin1') or the encoding 'any'.

Log

14         proc datasets lib = work;

15           modify class(encoding = any);

16         quit;

NOTE: MODIFY was successful for WORK.CLASS.DATA.

NOTE: PROCEDURE DATASETS used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

I just want to be sure that the dataset encoding will remain 'latin9' and won't turn into 'latin1' after the modification. It seems to be okay, according to the result of the CONTENTS procedure :

Output

Data Set NameWORK.CLASSObservations19
Member TypeDATAVariables5
EngineV9Indexes0
Createdvendredi 09 septembre 2011 15 h 23Observation Length40
Last Modifiedvendredi 09 septembre 2011 15 h 23Deleted Observations0
ProtectionCompressedNO
Data Set TypeSortedNO
Label
Data RepresentationHP_UX_64, RS_6000_AIX_64, SOLARIS_64, HP_IA64
Encodinglatin9 European (ISO)
Ask a Question
Discussion stats
  • 2 replies
  • 2842 views
  • 0 likes
  • 2 in conversation