Editing the Generated Code for a Job or Transformation

Problem

You want a result that cannot be easily achieved with the code that is generated for a job or transformation. Only a few changes are needed to the generated code.

Solution

You can edit the generated code for a job or transformation and save the edited code to the metadata server or to a separate file. If you save the code to a file, you might want to create a special directory for this type of code. Naturally, this method requires a basic understanding of the SAS programming language. The specified user-written code is retrieved whenever code for this job or transformation is generated.

Tasks

Edit and Save the Generated Code

Perform the following steps to generate code for a job, edit the code, and then save the edited code to the job's metadata or a file:
  1. Open the Code tab in the properties window for the job or transformation.
  2. Select User written body or All user written in the Code generation mode field. Any portion of the code that is not user-written is dimmed when you click User written body. You cannot modify this part of the code.
  3. Place the cursor in an editable section of the Code tab. Edit the generated code in the Code tab.
    Note: You can modify existing generated input and output macros. These macros use the following naming convention: _input_xxxx and _output_xxxx. The xxxx suffix is a descriptive keyword for the value of the macro.
  4. Click Save or Save As on the toolbar for the tab. The Save option enables you to save the code in the editor as a metadata object (instead of saving the code into a file). The Save As option opens the Save File window, where you can either save a name and description for the metadata object (code in the editor) or save the contents of the editor as a file.
    Note: The Save and Save As options apply your changes to the current session. To make your changes persist after the current session, you must save the entire job. To save the entire job, select Filethen selectSave from the menu bar on the desktop.
  5. Click OK to save the changes and close the properties window.
Last updated: January 16, 2018