06-25-2016
BellaLuna
Fluorite | Level 6
Member since
09-30-2015
- 10 Posts
- 5 Likes Given
- 0 Solutions
- 1 Likes Received
-
Latest posts by BellaLuna
Subject Views Posted 3045 06-25-2016 03:38 PM 1177 11-23-2015 09:56 PM 1195 11-23-2015 07:19 PM 3568 10-30-2015 09:58 AM 3569 10-30-2015 09:56 AM 3597 10-29-2015 06:26 PM 2126 10-28-2015 04:59 PM 2130 10-28-2015 04:55 PM 2156 10-28-2015 12:31 PM 2164 10-28-2015 12:01 PM -
Activity Feed for BellaLuna
- Posted Re: Create all possible combination of one variable by group of another variable on SAS Procedures. 06-25-2016 03:38 PM
- Liked Re: Create all possible combination of one variable by group of another variable for Ksharp. 06-25-2016 03:38 PM
- Liked Re: how to winsorize variable using SAS for Haikuo. 04-21-2016 02:06 PM
- Posted Re: pseudo codes execution: if VAR(t+1)>VAR(t) then output VAR(t) on SAS Programming. 11-23-2015 09:56 PM
- Liked Re: pseudo codes execution: if VAR(t+1)>VAR(t) then output VAR(t) for kannand. 11-23-2015 09:55 PM
- Posted pseudo codes execution: if VAR(t+1)>VAR(t) then output VAR(t) on SAS Programming. 11-23-2015 07:19 PM
- Posted Re: "ERROR: Variable has been defined as both character and numeric" with multiple dataset on SAS Data Management. 10-30-2015 09:58 AM
- Posted Re: "ERROR: Variable has been defined as both character and numeric" with multiple dataset on SAS Data Management. 10-30-2015 09:56 AM
- Posted "ERROR: Variable has been defined as both character and numeric" with multiple datasets using Macro on SAS Data Management. 10-29-2015 06:26 PM
- Got a Like for Re: Read excel files with non-standard format and restructure. 10-29-2015 10:21 AM
- Posted Re: Read excel files with non-standard format and restructure on SAS Data Management. 10-28-2015 04:59 PM
- Posted Re: Read excel files with non-standard format and restructure on SAS Data Management. 10-28-2015 04:55 PM
- Liked Re: Read excel files with non-standard format and restructure for PaigeMiller. 10-28-2015 04:54 PM
- Liked Re: Read excel files with non-standard format and restructure for PaigeMiller. 10-28-2015 12:34 PM
- Posted Re: Read excel files with non-standard format and restructure on SAS Data Management. 10-28-2015 12:31 PM
- Posted Read excel files with non-standard format and restructure on SAS Data Management. 10-28-2015 12:01 PM
-
Posts I Liked
Subject Likes Author Latest Post 1 4 1 1 1 -
My Liked Posts
Subject Likes Posted 1 10-28-2015 04:59 PM
06-25-2016
03:38 PM
This is very helpful. Thank you.
... View more
11-23-2015
09:56 PM
Thank you so much! This helps a lot!
... View more
11-23-2015
07:19 PM
Hello!
I'm just starting to learn SAS, I have a seemingly straightforward logic that I don't know how to execute. If possible, would you please provide me an Example coding?
What I need to do is:
If within the same code, Interest(t+1)is less than Interest(t), then output coupon=interest(t), keep date, code. In the example below, it is observation 6.
obs. date code interest
1 1/1/2015 1 0.2
2 1/2/2015 1 0.5
3 1/3/2015 1 1.9
4 1/4/2015 1 2.5
5 1/5/2015 1 3.8
6 1/1/2015 2 2.1
7 1/2/2015 2 0
8 1/3/2015 2 0.1
9 1/4/2015 2 0.2
10 1/5/2015 2 0.3
output sample should look like either:
obs. date code interest coupon
1 1/1/2015 2 2.1 2.1
or
obs. date code interest coupon
1 1/1/2015 1 0.2
2 1/2/2015 1 0.5
3 1/3/2015 1 1.9
4 1/4/2015 1 2.5
5 1/5/2015 1 3.8
6 1/1/2015 2 2.1 2.1
7 1/2/2015 2 0
8 1/3/2015 2 0.1
9 1/4/2015 2 0.2
10 1/5/2015 2 0.3
... View more
10-30-2015
09:58 AM
Hi, I'm not familiar with sql language, would you mind iterate? Thank you!
... View more
10-30-2015
09:56 AM
Hello,
Thanks for the reply. I understand the error msg and what caused it, but I need advice on how to solve it under my macro codes, instead of doing it one excel sheet by another, becuase I have hunderds of excel sheets. Any sugguestions on revising the code?
... View more
10-29-2015
06:26 PM
Hello!
Basically I need to import multiple excel files and simply stack them. I wrote a Macro to do that, but at the end of the code where it comes to the stack part, multiple error messages appear saying:
ERROR: Variable XX has been defined as both character and numeric.
I tried to modify format in the Macro, but it doesn't work.
Will you please take a look at my code and let me know how I should modify it?
Here's the code:
%LET TOTAL=4;
%LET PATH=H:\test\;
%LET INFILE1=a (1).xlsx;
%LET INFILE2=a (2).xlsx;
%LET INFILE3=a (3).xlsx;
%LET INFILE4=a (4).xlsx;
%MACRO EXCELREAD(I,INFILE);
PROC IMPORT OUT=TEST_&i
DATAFILE="&PATH.&INFILE"
DBMS=EXCEL REPLACE;
GETNAMES=NO;
MIXED=YES;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;
RUN;
%MEND;
%EXCELREAD(1,&INFILE1);
%EXCELREAD(2,&INFILE2);
%EXCELREAD(3,&INFILE3);
%EXCELREAD(4,&INFILE4);
data pilot_bond;
set test_1
test_2(firstobs=2)
test_3(firstobs=2)
test_4(firstobs=2)
run;
Here's the error message:
3712 data pilot_bond; 3713 set test_1 3714 test_2(firstobs=2) 3715 test_3(firstobs=2) 3716 test_4(firstobs=2) ERROR: Variable F1 has been defined as both character and numeric. ERROR: Variable F2 has been defined as both character and numeric. ERROR: Variable F6 has been defined as both character and numeric. ERROR: Variable F7 has been defined as both character and numeric. ERROR: Variable F6 has been defined as both character and numeric. ERROR: Variable F6 has been defined as both character and numeric. 3730 run;
Any help will be greatly appreciated!
Sugguestions to further simplifying the code is also very welcome.
... View more
10-28-2015
04:59 PM
1 Like
Done. Thanks.
... View more
10-28-2015
04:55 PM
Thanks a bunch!
... View more
10-28-2015
12:31 PM
Thank you! Now I know it's doable. I'm very new to SAS and I apologize for the naiveness of the problem. But would you be willing to write down a somewhat code of the process that I can start to learn and adjust?
... View more
10-28-2015
12:01 PM
Hi all,
Greetings!
My problem is, I have hundreds of excel files that look like this:
I need it eventually to become panel data that look like this:
which is just copy the first few rows and transpose them next to the price column, and then drag to the end to have the same value.
Since I have hundreds of excel files like this, it's not feasible to do it one file after another mannually. I wonder if there's way to program in SAS that can import all the excel files and for each file, structure to the final layout?
Any help will be greatly appreciated!
Best,
Xinxin
... View more