As the first step in the decommissioning of the site has been converted to read-only mode.

Here are some tips for How to share your SAS knowledge with your professional network.

Zw. Format

From sasCommunity
Jump to: navigation, search

SAS has a special numeric format to append leading zeros called Zw.d

This greatly helps with all numeric and character data received that requires leading zeroes during SAS processing


w -> Width of variable.

This should account for the value, the decimal point, and a minus sign depending on requirements

d -> Decimal Point.

If d is 0 or if you omit d, Zw.d writes the value without a decimal point.

For eg. To generate a char var with length 6 by appending leading zeroes using Zw.d

var_y = put (var_y, z6.);

Practical use

- To format client_nos, group_nos, social_security_nos, procedure_codes etc.