- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have a data with some remarks field as common, I want to know the count of that data and the sum
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi and welcome to the communities!
Please give us an example for your dataset, ideally in a data step with datalines (so we can easily recreate it for testing).
Use the "little running man" button (right next to the one indicated) to post your code:
The one indicated is best for logs and text data (e.g. from CSV files).
And show us what you expect as a result. If you already tried code to solve your issue, post that also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I want to know how many C type of apples and the count and sum of the amount... etc
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Do you think of something like this:
data have;
infile '/folders/myfolders/datasas.csv' dlm=',' dsd truncover;
input date :mmddyy10. amount name $ type :$1.;
format date yymmddd10.;
run;
proc sql;
create table want as
select
name,
type,
count(name) as count,
sum(amount) as amount
from have
group by name, type
;
quit;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Q1. I am using windows 10 and the datasas file is on my desktop "C:\Users\prathap\Desktop"; how to map it
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Do you have a licensed SAS installation, or University Edition?
If licensed, locally on your desktop or on a server?
If server, do you use SAS Studio or Enterprise Guide?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Use the File Copy task in Enterprise Guide to copy the file to your server.
Then you can run the code I used, only adapting the location of the csv file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am NOT talking about the dataset upload/download, I am talking about the COPY FILES TASK, which is part of the standard EG setup at least since version 7.13. This task can copy ANY file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you like to live in the past, why do you use Windows 10 instead of XP, which is about as old?
Really, you should update to 7.15 or 8.2 ASAP, you're missing out on a tankerload of features.
And the current version is always included in SAS licenses.
Read the blog article, @ChrisHemedinger also provides the task as an add-on to earlier EG versions.
Without the task, you can always use a SFTP client to upload data to your SAS server, or use a shared network resource that is available both on your desktop and server. In the end, the file has to be "visible" to your SAS session, so you can run my code.
You can also use the import wizard of EG, but you need to supply the column names, types and formats yourself, since your csv file does not have a header line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Jprathap447 -
Welcome to the community and to the world of SAS. The version of SAS Enterprise Guide that you're using is quite old, but you still might benefit from this tutorial. It's 2+ hours and covers what you need to know about working within the environment, and completing basic tasks like querying and summarizing data.