/***************************************************************************//*
Title: Convert a SAS date to a character variable *// *
*//* Goal: Use the PUT function to create a character variable from *//*
a SAS date. *//* *//***************************************************************************/
data one;
input sasdate :mmddyy6.;
datalines;
010199;
run;
data two;
set one;
chardate=put(sasdate,mmddyy6.);
run;
/* RESULTS */
Obs sasdate chardate
1 14245 010199
Source: ftp://ftp.sas.com/techsup/download/sample/datastep/convertchar.html
Subscribe to:
Post Comments (Atom)
Learn how to view SAS dataset labels without opening the dataset directly in a SAS session. Easy methods and examples included!
Quick Tip: See SAS Dataset Labels Without Opening the Data Quick Tip: See SAS Dataset Labels With...
-
1) What do you know about CDISC and its standards? CDISC stands for Clinical Data Interchange Standards Consortium and it is developed ke...
-
Comparing Two Approaches to Removing Formats and Informats in SAS Comparing Two Approaches to Removing Formats...
-
USE OF THE “STUDY DAY” VARIABLES The permissible Study Day variables (--DY, --STDY, and --ENDY) describe the relative day of the observ...
Fine, but what about a date like 01011999, which there doesn't appear to be a date format for?
ReplyDeleteyou use mmddyy8. format instead of mmddyy6.
ReplyDelete