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

Hi Experts,

 

I have never worked with datalines before. For testing purposes, I have to create the following table.  

SAS dataset

 

How should I write the code get this table?

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Please post code as TEXT in a "little running man" subwindow.

Post logs or other textual data, where the formatting is relevant, into a {i} subwindow.

Post screenshots (only when necessary, and text can't be copied with copy/paste) using the "Photos" button.

DO NOT USE THIRD-PARTY REPOSITORIES for images. These are usually broken by firewalls that prevent access to cloud services.

The latter means I can't open your picture.

See this example for reading dates from datalines:

data want;
input mydate :yymmdd10.;
format mydate yymmddd10.;
datalines;
2019-04-25
;
run;

PS after reloading your post, I could see the picture.

See this code:

data want;
input cust_id Name $ date :ddmmyy10. minutes circle $;
format date ddmmyy10.;
datalines;
2 Henry 01/04/2014 1780 roaming
;
run;

View solution in original post

3 REPLIES 3
Kurt_Bremser
Super User

Please post code as TEXT in a "little running man" subwindow.

Post logs or other textual data, where the formatting is relevant, into a {i} subwindow.

Post screenshots (only when necessary, and text can't be copied with copy/paste) using the "Photos" button.

DO NOT USE THIRD-PARTY REPOSITORIES for images. These are usually broken by firewalls that prevent access to cloud services.

The latter means I can't open your picture.

See this example for reading dates from datalines:

data want;
input mydate :yymmdd10.;
format mydate yymmddd10.;
datalines;
2019-04-25
;
run;

PS after reloading your post, I could see the picture.

See this code:

data want;
input cust_id Name $ date :ddmmyy10. minutes circle $;
format date ddmmyy10.;
datalines;
2 Henry 01/04/2014 1780 roaming
;
run;
Myurathan
Quartz | Level 8

Sorry for the screenshot. The table should look like below.

 

Cust_ID  |   Name  |  Date            |  Minues | Circle

2              |   Henry  | 01/04/2014   | 1780     | roaming  

 

 

Myurathan
Quartz | Level 8
Thank you so so much.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 25141 views
  • 4 likes
  • 2 in conversation