CLIENT_ENCODING= LIBNAME Statement Option

Specifies the encoding to use when transferring data from your DBMS.

Valid in: SAS/ACCESS LIBNAME statement
Category: Data Access
Default: current SAS session encoding
Restriction: This option applies only to UNIX environments.
Interaction: This option overrides any value that you might have set for the PGCLIENTENCODING environment variable.
Data source: PostgreSQL
Examples: Set the CLIENT_ENCODING= LIBNAME option:
libname mydb postgres server=myserver port=5432 
    user=myuser password='mypwd' database=mydb1 client_encoding='utf8';
Specify the PGCLIENTENCODING environment variable on PC hosts:
PGCLIENTENCODING UTF8
Specify the PGCLIENTENCODING environment variable on UNIX hosts:
export PGCLIENTENCODING=UTF8
Specify the PGCLIENTENCODING environment variable at SAS invocation:
sas -set PGCLIENTENCODING=UTF8

Table of Contents

Syntax

CLIENT_ENCODING='encoding'

Syntax Description

encoding

specifies the encoding to use when transferring data into SAS.

Details

For a list of encoding values, see Encodings and Their Aliases and Encoding Character Set Compatibility in SAS National Language Support (NLS): Reference Guide.

Last updated: February 3, 2026