• 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 2025
      • 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.
317 results
Sorted by:
Best Match
  • Date
  • Views
  • Likes
  • Replies
  • Best Match

data reshaping

by Calcite | Level 5 nbora in New SAS User
‎12-12-2024 03:27 PM
‎12-12-2024 03:27 PM
...0DEC2013 456 987654321DEF 31JAN2014 456 987654321GHI 02FEB2014 ;​ I would like to reshape this data where the values of col_b are transposed to new columns and the minimum of the date column per c...
Show results in replies (1)
  • Reshaping the data like this only make programming the next step(s) harder. Don't do it. &n...

Reshaping data

by Calcite | Level 5 coder1 in SAS/IML Software and Matrix Computations
‎05-23-2018 04:23 PM
‎05-23-2018 04:23 PM
I want to reshape a matrix created in IML and convert it to a sas dataset while retaining the column and row names. For example,  suppose I have an N by N matrix with row and column names.&n...
Show results in replies (1)
  • Yes, you can "trust Varnames to be in the right order." You can also simplify your program b...

Do LOOP reshape table

by Fluorite | Level 6 lgonza22 in SAS Programming
‎09-23-2020 04:12 PM
‎09-23-2020 04:12 PM
Hi,   I need assistance in transforming Table 1 below into Table 2 The last 2 characters of the column headers need to match. I have color coordinated them below. The last two characters ...
Show results in replies (3)
  • ...bout reshaping your data using DO loop and arrays.  
  • ...ow-to-reshape-data-wide-to-long-using-proc-transpose/ https://stats.idre.ucla.edu/sas/modules/reshaping...
  • Hi @lgonza22  et al, Sorry about my late entry to the party. Anyways, I get the feeling, ...

Reshaping data

by Barite | Level 11 Miracle in SAS Data Management
‎08-27-2015 10:03 PM
‎08-27-2015 10:03 PM
Dear SAS community, wish you all well. Can I please ask how do I improve my SAS code to my problem? I have included a small partial output of how my exact data is like. I wish to reshape my d...
Show results in replies (1)
  • data want (keep=site role gender freq); set have; retain site 0; array f {*} f2-f7; do role = 1...

Matrix reshaping

by Quartz | Level 8 xtc283x in SAS/IML Software and Matrix Computations
‎10-09-2015 06:53 AM
‎10-09-2015 06:53 AM
I have a matrix, x, that is numeric and 49X47. The second row contains all missing values. I would like to reshape it to a square matrix that is 47x47 by eliminating the first and second rows.&n...
Show results in replies (1)
  • ...rror.   First use the subscript operator to  extract the nonmissing rows, then reshap...

Reshaping data from long to wide

by Fluorite | Level 6 jlee8 in SAS Programming
‎11-04-2020 05:35 PM
‎11-04-2020 05:35 PM
Hello,   I'm not sure if SAS does support a manipulation like this but if there is a way, please advise.   I have a dataset that look like the following.    From   ...
Show results in replies (1)
  • ...ide-using-proc-transpose/ https://stats.idre.ucla.edu/sas/modules/reshaping-data-long-to-wide-using-t...

Reshaping the Data

by Obsidian | Level 7 kngu022 in New SAS User
‎02-15-2020 08:47 AM
‎02-15-2020 08:47 AM
I have this codes below. As I understand the length of item is from 1-13, IDnum is from 15-19 , Instock 21-22  backord 24-25. the order that variable will be stored in the data is item indnum ...
Show results in replies (1)
  • Hi @kngu022,   During the compilation phase (before execution), the Program Data Vect...

How to reshape data?

by Obsidian | Level 7 ervinodsingh in SAS Programming
‎05-09-2017 07:31 AM
‎05-09-2017 07:31 AM
Hi have data like  a 4 a 3 a 6 b 3 b 7 b 8 c 1 c 5 c 7   and want my data to the form  4 3 1 3 7 5 6 8 7    
Show results in replies (1)
  • Or the followng code could get you more slick. No need input 3 by hand .   data have; i...

reshape table by two variables

by Quartz | Level 8 sasecn in SAS Programming
‎01-26-2021 11:45 PM
‎01-26-2021 11:45 PM
Hello: I have a table "have" which can be created by the code attached. I would like to reshape it to the table "want" (see eg in the code). Basicly, the table "have" contains the counts of types o...
Show results in replies (2)
  • Try data want; set have; length v1_type v2_type $ 4 count 8 _varName $ 32 ...

How to reshape data?

by Pyrite | Level 9 GPatel in SAS Programming
‎05-26-2016 06:09 PM
‎05-26-2016 06:09 PM
  RAW_DATA               Obs Flag_A Flag_B Flag_C Flag_D Flag_E Flag_F Flag_G N 1 No       ...
Show results in replies (1)
  • Arrays would come in handy, especially if you actually have more than six variables:   dat...
  • « Previous
    • 1
    • 2
    • 3
  • Next »
Powered by Khoros