BookmarkSubscribeRSS Feed
Mohan_Reddy
Obsidian | Level 7
I Have attached the output Report.....and 
inside i put the existing dataset..
So please anyone just saw the existing dataset and
give a solution for this how to transform existing data into out output Report

Screenshot (17).pngScreenshot (19).png

11 REPLIES 11
Mohan_Reddy
Obsidian | Level 7

Actually i got in CSV and Excel files only so after import into SAS i send that pictures...For your i am provide that CSV and Excel files here please find it.

andreas_lds
Jade | Level 19

Because you didn't ask for help importing the csv-files: Please post the code you are using to read ALL this files, and include the code required to get to the point where you actually are. And by "post" i mean as text using the little running man icon, NOT as attachments!

Mohan_Reddy
Obsidian | Level 7

proc import datafile="C:\Users\Coputer15\Desktop\Sub-Broker active AM Report\RAD1.csv" out=work.RAD1
dbms=csv replace;
run;

proc import datafile="C:\Users\Coputer15\Desktop\Sub-Broker active AM Report\RAD2.csv" out=work.RAD2
dbms=csv replace;
run;

proc import datafile="C:\Users\Coputer15\Desktop\Sub-Broker active AM Report\RAD3.csv" out=work.RAD3
dbms=csv replace;
run;

proc import datafile="C:\Users\Coputer15\Desktop\Sub-Broker active AM Report\RAD4.csv" out=work.RAD4
dbms=csv replace;
run;

 

 

 

 


%macro import(file,dname);
proc import datafile="&file" out=&dname
dbms=excel replace;
getnames=yes;
run;
%mend;

%import(C:\Users\Coputer15\Desktop\Sub-Broker active AM Report\RAD6.xls,RAD6);

Mohan_Reddy
Obsidian | Level 7
These for import 5 CSV files into SAS

proc import datafile="C:\Users\Coputer15\Desktop\Sub-Broker active AM Report\RAD1.csv" out=work.RAD1
dbms=csv replace;
run;

proc import datafile="C:\Users\Coputer15\Desktop\Sub-Broker active AM Report\RAD2.csv" out=work.RAD2
dbms=csv replace;
run;

proc import datafile="C:\Users\Coputer15\Desktop\Sub-Broker active AM Report\RAD3.csv" out=work.RAD3
dbms=csv replace;
run;

proc import datafile="C:\Users\Coputer15\Desktop\Sub-Broker active AM Report\RAD4.csv" out=work.RAD4
dbms=csv replace;
run;

proc import datafile="C:\Users\Coputer15\Desktop\Sub-Broker active AM Report\RAD5.csv" out=work.RAD5
dbms=csv replace;
run;


these code for import 1 excel file into SAS.

%macro import(file,dname);
proc import datafile="&file" out=&dname
dbms=excel replace;
getnames=yes;
run;
%mend;

%import(C:\Users\Coputer15\Desktop\Sub-Broker active AM Report\RAD6.xls,RAD6);


please write a programme how to get that required output...
Kurt_Bremser
Super User

So you first need to join all those imported tables, and get them into the right order for the report. Do that first. You can calculate the differences in this step, and assign proper labels to all your columns.

(Joining tables is very simple SAS technique and can't be a problem if you already advanced to complex reporting)

Then you should start experimenting with proc report, using the relevant columns for grouping, and the numeric columns for analysis.

ballardw
Super User

@Mohan_Reddy wrote:
These for import 5 CSV files into SAS

proc import datafile="C:\Users\Coputer15\Desktop\Sub-Broker active AM Report\RAD1.csv" out=work.RAD1
dbms=csv replace;
run;

proc import datafile="C:\Users\Coputer15\Desktop\Sub-Broker active AM Report\RAD2.csv" out=work.RAD2
dbms=csv replace;
run;

proc import datafile="C:\Users\Coputer15\Desktop\Sub-Broker active AM Report\RAD3.csv" out=work.RAD3
dbms=csv replace;
run;

proc import datafile="C:\Users\Coputer15\Desktop\Sub-Broker active AM Report\RAD4.csv" out=work.RAD4
dbms=csv replace;
run;

proc import datafile="C:\Users\Coputer15\Desktop\Sub-Broker active AM Report\RAD5.csv" out=work.RAD5
dbms=csv replace;
run;


these code for import 1 excel file into SAS.

%macro import(file,dname);
proc import datafile="&file" out=&dname
dbms=excel replace;
getnames=yes;
run;
%mend;

%import(C:\Users\Coputer15\Desktop\Sub-Broker active AM Report\RAD6.xls,RAD6);


please write a programme how to get that required output...

Given your proc import code I am going to bet that you have none of the AM_CODE or TM_CODE values of OTHER that appear in your data. You may also not have any OTHER value for STATE_HEAD_CODE. I suspect that you may have different lengths for the AM_NAME, SH_NAME and TM_NAME variables in the different data sets. Which can lead to issues when the data is combined as well. And depending on the actual data files (I didn't look at all of them) there is a chance that you have a couple of variables that are numeric in one set and character in another.

 

Have you looked at proc contents for your imported data sets to verify that variables have the same type and length so there won't be problems when combining the data?

Mohan_Reddy
Obsidian | Level 7

I had provide 5 csv files please find another one excel file...I provide just justification about this please find that also..

 

Edit by KB, text from file:

Report Name:
SUB-BROKER ACTIVE AM REPORT

Task
Data is available in different csv files like

Inwards day data is available in RAD1.CSV
NCA day data is available in RAD2.CSV

Inwards month data is available in RAD4.CSV
NCA mont data is available in RADD6.CASV

Inwards last month data is available in RAD3.CSV
NCA last month data is avilable in RAD5.CSV


Extract all the excel files into SAS
and manage the data according to your output report.

create macros for date file and give dates and monts dynamically

your output report should match 100% in all aspects like data & formatting  with output what i given.
Mohan_Reddy
Obsidian | Level 7

I Can't understand how this existing data transformed into output report..please give a solution for this ....

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
  • 11 replies
  • 1528 views
  • 1 like
  • 4 in conversation