BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
GPatel
Pyrite | Level 9

I have attached testdata.xls file.

 

Here is the issue, look at Obs # 1.

How can I make obs # 1 that should mimic to obs # 2 ?

 

Somehow file got corrupted, and contents splitted and shifted one column to the right in obs # 1 Column A (obs # 1),

Obs # 2 is correct way of representation of data.

 

In Obs # 1,

Salesman_name_dept should be : Michael Perry A001 Manufacturing

Sale_date should be :  10-Jan-09

Reorder should be : 50

Event should be : 10

BuySell should be : 45.45

Amount should be : 5000.75

 

Appreciate any help !

 

1 ACCEPTED SOLUTION

Accepted Solutions
GPatel
Pyrite | Level 9

Issue has been resolved. Thanks to SAS communities members !

 

- GPatel

View solution in original post

3 REPLIES 3
ballardw
Super User

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.

 

Use this link to create a data step that you can post as text or attach as a text file for better description of your data: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

 

It also helps to provide the layout of the expected results.

Shmuel
Garnet | Level 18

You can repair your data-set  by overriding 1st observation values.

Pay attention to variables type:  CHAR or NUM to write the correct values as correct litterals;

 

 

data new;

 set old;

   if _N_ = 1 then do;

    Salesman_name_dept = "Michael Perry A001 Manufacturing";

    Sale_date =  '10Jan09'd;

    Reorder    = 50;

    Event = 10;

    BuySell = 45.45;

    Amount = 5000.75;

 end;

run;

 

 

GPatel
Pyrite | Level 9

Issue has been resolved. Thanks to SAS communities members !

 

- GPatel

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 1126 views
  • 0 likes
  • 3 in conversation