• Community
    • Home
    • Welcome
      • Getting Started
      • Community Memo
      • All Things Community
      • SAS Customer Recognition Awards (2024)
      • SAS Customer Recognition Awards (2023)
    • SAS Community Library
    • SAS Product Suggestions
    • Upcoming Events
    • SAS Customer Recognition Awards
    • All Recent Topics
  • Learn
    • New SAS User
    • SAS Software for Learning Community
    • Ask the Expert
    • SAS Certification
    • SAS Tips from the Community
    • SAS Training
      • Programming 1 and 2
      • Advanced Programming
      • Course Case Studies and Challenges
      • Trustworthy AI
    • SAS Global Forum Proceedings 2021
    • Tech Report Archive
    • SAS Insights Archive
  • Programming
    • SAS Programming
    • SAS Procedures
    • SAS Enterprise Guide
    • SAS Studio
    • Graphics Programming
    • ODS and Base Reporting
    • SAS Code Examples
    • SAS Web Report Studio
    • Developers
  • Analytics
    • Statistical Procedures
    • SAS Data Science
    • Mathematical Optimization, Discrete-Event Simulation, and OR
    • SAS/IML Software and Matrix Computations
    • SAS Forecasting and Econometrics
    • Streaming Analytics
    • Research and Science from SAS
  • SAS Viya
    • SAS Viya
    • SAS Viya on Microsoft Azure
    • SAS Viya Release Updates
    • Moving to SAS Viya
    • SAS Visual Analytics
    • SAS Visual Analytics Gallery
    • Your Journey to Success
    • SAS Viya Workbench
      • SAS Viya Workbench: Getting Started
      • SAS Viya Workbench Discussion
      • SAS Viya Workbench: Release Updates
  • Administration
    • Administration and Deployment
    • Architecture
    • SAS Hot Fix Announcements
    • SUGA
  • Solutions
    • Microsoft Integration with SAS
    • Decisioning
    • SAS Decision Builder
    • Data Management
    • Customer Intelligence
      • SAS Customer Intelligence
      • SAS Customer Intelligence 360 Release Notes
      • SAS 360 Match
    • Risk and Fraud
      • SAS Risk Management
      • Fraud, AML and Security Intelligence
      • SAS Risk Release Updates
      • Risk & Finance Analytics
      • Insurance Fraud
      • MRM AI Governance Working Group
      • SAS Quant Community
    • SAS Health
      • SAS Health and Life Sciences
      • SAS Life Science Analytics Framework
  • Hubs
    • Regional Hubs
      • SAS User Groups
      • SAS Community Nordic
      • AML Nordic User Group
      • SAS Japan
      • SAS Korea
      • CoDe SAS German
      • SAS Plattform Netzwerk
      • SAS Brazil Community
      • SAS Spanish Community
      • SAS Users Group in Israel
      • 欢迎来到SAS中文社区!
      • Ottawa Area SAS Users' Society
      • Toronto Area SAS Users Group
      • SAS Türkiye Community
    • Special Interest Hubs
      • SAS Hacker's Hub
      • SAS Innovate 2026
      • SAS Analytics Explorers
      • The Curiosity Cup
      • SAS Inner Circle Panel
      • SAS Hackathon Team Profiles (Past)
      • SAS Explore
      • Reporting and Optimization
      • Intern Alumni Network Community
Sign In

Search the Community

Showing results for 
Search instead for 
Did you mean: 
Search Options
  • Subscribe to RSS Feed for this Search
Advanced Hide Advanced
  • Posts
  • Users
  • Places
  • Products
Advanced Search Options
Search Modifiers:
You can apply modifiers to the terms you enter in the search field.
Use quotes to search for an "exact phrase".
Use the plus sign to search for +one +or +more +words.
Use the minus sign to -exclude -certain -words from your search.
Limits search results to topics that have no replies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
1,251 results
Sorted by:
Best Match
  • Date
  • Views
  • Likes
  • Replies
  • Best Match

Format proc report to output dates in excel using ods excel

by Fluorite | Level 6 Kia_B in SAS Programming
‎04-30-2024 07:04 AM
‎04-30-2024 07:04 AM
I am attempting to output an excel (xlsx) file using ods excel from a proc output. My variables are in date9. format in the SAS data set, but when they output to excel they are in a text format.&n...
Show results in replies (3)
  •   Here are the dates in Excel.      here is the code with the format. I...
  • ...ays, they wind up as numeric dates in Excel.   data a; date='01JAN2024'd; run; ods excel f...
  • I found when I remove the "cellwidth= " from the style (column) statement, then the date displays c...

Import an Excel file containing dates

by Pyrite | Level 9 Gick in SAS Programming
‎01-26-2023 06:51 AM
‎01-26-2023 06:51 AM
Hello,   I have a database in Excel with a date variable of modalities 01/21/2022, 03/02/2019, 06/01/2010, etc. When I import it into SAS, the date variable contains the modalities 44949. I...
Show results in replies (5)
  • A quick search of the forum for "Excel dates" turns up plenty of correct answers https://c...
  • ...f things to note: Excel stores dates as a number e.g. 1 = 01 Jan 1990, 2 = 02 Jan 1990, ... Excel...
  • Excel does not work with dates prior to 1900 because it perpetuates a bug (actually, a trick to s...
  • ...an deal with special values which cause the IMPORT problem (reading dates as character). &n...
  • if you already have a numeric value use YOUR_DTC=put(XLSX_COLUMN_NAME-21916,e8601da.); Diffic...

Excel to SAS date format issues

by Obsidian | Level 7 fordcr2 in New SAS User
‎03-01-2019 10:44 AM
‎03-01-2019 10:44 AM
Hello,    I know there are a lot of posts about formatting dates, but I have not been able to find one that works for my problem. I am trying to import data where the dates are f...
  • Tags:
  • dates
  • format dates
  • XLSX
Show results in replies (1)
  • ...  SAS stores dates from 1960 and Excel uses 1900 as the basis.  But SAS numbers from zero a...

cannot read in dates in this excel sheet

by Quartz | Level 8 rykwong in SAS Programming
‎10-12-2023 04:35 PM
‎10-12-2023 04:35 PM
...ut it generated many uninterpretable data.  Please see the second screenshot.  How can I read this column in to capture all the values as dates. Thanks again   datestudy=input(date...
Show results in replies (2)
  • Your first picture tells me that your "dates" are a mix of character and numeric values in Excel. W...
  • So is the first one what EXCEL shows and the second is what you get if you run PROC IMPORT on the EXCEL...

Import data from Excel including date format

by Lapis Lazuli | Level 10 jonatan_velarde in SAS Programming
‎03-31-2016 09:40 AM
‎03-31-2016 09:40 AM
Good morning my friends:   I have studied lots of tutorials talking about how to import correctly EXCEL files into SAS UNIERSITY EDITION, unfortunely all the trials were unsuccesfull, here i...
  • Tags:
  • data
  • excel
  • format
Show results in replies (2)
  • As excel reads the dates with some other cut off date try applying new_date=animal_birth_date-(60*3...
  • You can try, but there's too many factors in play.    It depends on the version of Excel...

Proc Import with Excel File Dates Wrong

by Calcite | Level 5 erin3 in New SAS User
‎10-17-2021 04:26 PM
‎10-17-2021 04:26 PM
Hi! When I import this excel file, the dates come in as a random set of numbers that aren't in date format or correct. Below is the import code I'm using. Can someone please correct me to get them t...
Show results in replies (1)
  • ...alue for the dates stored as a character string. Below one way how to convert these strings from Excel...

Having problems with ODS Excel and dates and highlighting

by Obsidian | Level 7 SASGeek in ODS and Base Reporting
‎07-09-2024 04:57 PM
‎07-09-2024 04:57 PM
Hello, I'm have a problem with no highlighting in my results. I get results as expected (and yes, there is a 31Aug2022 in my dates) but nothing highlights. My code is as follows:   %let a...
Show results in replies (1)
  • ...bsp; See the modification below and try it.  define date_asof / "As of Date" f=weekdate17. w...

Importing Excel Date as number (YYYYMM) into SAS as Date.

by Calcite | Level 5 AlexPanebianco in SAS Programming
‎02-16-2022 06:53 AM
‎02-16-2022 06:53 AM
...and will require importing.   One of my columns in Excel is a "date" column, written as YYYYMM (so, October 2015 would be 201510). This is stored in Excel under General format and not as a...
Show results in replies (1)
  • You only need a simple conversion step after import: data have; date = 201510; run; data w...

Correcting Dates from Excel to SAS NOT using - 21916

by Fluorite | Level 6 leackell13 in SAS Programming
‎09-30-2022 01:05 PM
‎09-30-2022 01:05 PM
Hi,   I originally received 2 Excel sheets to merge together for this project. After I merged them, I successfully corrected the dates using this code:   DATA SubQ.dataclean1; S...
Show results in replies (5)
  • ...un;quit; Because the Excel dates get read as character the SAS columns contain a string of digits t...
  • ...4-2022 Kelly edit dates only.xlsx" DBMS=excel REPLACE ; dbdsopts= "dbtype=( postop_XR_date='date...
  • Thanks! Just converting the file to a CSV file worked; the dates just imported how I wanted them t...
  • ...ibname xx xlsx "C:\downloads\Master Compiled Spreadsheet 09-14-2022 Kelly edit dates only.xlsx"; NOTE: L...
  • ...ostop_XR_date, mmddyy10.); /* Change dates from character to date values */ 74 format date_varXR1 m...

Date Help in ODS Excel Title

by Fluorite | Level 6 BobbyG0627 in SAS Programming
‎08-09-2022 05:46 PM
‎08-09-2022 05:46 PM
...1JUN2022; %let ToDate=31JUL2022; I reference it all throughout the program with no issues. When it comes time to produce the excel output though it only comes out in sas date format, I need it in m...
Show results in replies (2)
  • ...9.), mmddyy10.)"; Here's a great, but longer and in depth, reference for dates and times in SAS h...
  • Macro variables, such as you create, are TEXT. As such the only "format" that applies is the $ form...
  • « Previous
    • 1
    • 2
    • 3
  • Next »
Powered by Khoros