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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 28172 views
  • 4 likes
  • 2 in conversation