BookmarkSubscribeRSS Feed
BillB
Fluorite | Level 6

I'm trying to recode a column to show that in column A a  1 (Numeric) = Private Passenger (Char)

I'm getting syntax errors e. g.

 

ERROR: The following columns were not found in the contributing tables: Private_Passenger.

Not sure what I'm doing wrong.

Any help is appreciated.

1 REPLY 1
ChrisHemedinger
Community Manager

The best long term approach for this is to create a SAS format. 

In EG there are two ways to create formats (actually, three ways if you don't mind writing code).

The two tasks are:

- Tasks->Data->Create Format

- Tasks->Data->Create Format from Data Set

They are both straightforward to use, but I like the second one if you have lots of values to map.  It might be easier to enter the values in a data set or read them in from an Excel spreadsheet (perhaps you already have them in that form).

Once you have a SAS format, you can apply it within any task using this approach:

Just-in-time data prep in SAS Enterprise Guide - The SAS Dummy

In the Query Builder, you can also change the properties of any output column to include a custom format that you have defined.

Chris

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1955 views
  • 0 likes
  • 2 in conversation