Substituting "19xx"  with "18xx"

Posted on 2013-09-11
Medium Priority
Last Modified: 2013-09-11

I have a four-digit column (columna) that begins with either "18" or "19".  If the column begins with "19", I would like to substitute with "18" for lookup purposes.

Can you tell me how to do this in SAS?
Question by:morinia
LVL 11

Accepted Solution

theartfuldazzler earned 2000 total points
ID: 39484368

If substr(col1,1,2) = "19" then substr(col1,1,2) = "18";
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 39484419
Why don't you update the column to deduct 1000 for all the records above 1900

update table
set columna = columna - 1000
where columnA >=1900

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Microsoft Jet database engine errors can crop up out of nowhere to disrupt the working of the Exchange server. Decoding why a particular error occurs goes a long way in determining the right solution for it.
I recently worked on a Wordpress site that utilized the popular ContactForm7 (https://contactform7.com/) plug-in that only sends an email and does not save data. The client wanted the data saved to a custom CRM database. This is my solution.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Watch the video of Kernel Migrator for SharePoint, which demonstrate the process easily of migration from SharePoint to SharePoint, OneDrive for Business & Google Drive servers, Public Folder to SharePoint, File Server to SharePoint. The tool has va…

588 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question