Considerations for Manually Editing Code

Before You Manually Edit Code

The code generation features in SAS Visual Data Builder can generate a lot of SAS statements with a few simple clicks. Depending on your needs, you might benefit by using the Design tab for adding input tables, performing joins, and filtering data before you customize the generated code.
The following features and settings must be specified before you unlock the code:
Unique values
Selecting this check box determines whether the DISTINCT keyword is included in the generated PROC SQL statement. After you unlock the code, the check box cannot be used to include the keyword.
Append data
Selecting this check box enables you to use the generated SAS statements for appending data to the output table before you unlock the code.
Output table
You must specify the table name, location, and library, and you must save the data query before you unlock the code. When you save the data query, the metadata for the table is registered.
Use a staging table
Selecting this check box registers the metadata for the table when you save the data query. Select the check box, specify the library, and save before you unlock the code.

Table and Column Metadata

After unlocking the code and saving it, the columns in the output table are removed from metadata. This is because the data builder uses the columns selected on the Design tab to create column metadata, and those column selections are no longer available after you unlock the view on the Code tab.
When you run the unlocked data query, the column metadata is registered as part of running the code. However, the columns might not be visible in the data builder immediately because the table metadata (without any columns) is cached in the application.

Input and Output Libraries

When you unlock the code for manual editing, you must specify the libraries to use for your tables. You can do this with LIBNAME statements. If you dragged and dropped the tables onto the workspace before you unlocked the code for manual editing, then the LIBNAME statements for the tables are automatically included.

See Also

SAS Statements: Reference
SAS/ACCESS for Relational Databases: Reference

Output and Staging Tables

Specify the table names, locations, and libraries on the Outputs tab just as you do on the Design tab.
Note: Specify the tables and save the data query before you unlock the code. If you do not specify the table name or the table name is already in use, then you are not able to save the data query.

See Also

SAS Language Interfaces to Metadata

Validate Custom Code

If you entered SAS statements in the Preprocess or Postprocess view, then those statements are not validated when you click the Validate query button.
If you unlock the code in the All Code view, then the Validate query button is disabled. You cannot validate customized code.