Date: Mon, 3 Oct 2011 09:27:49 -0400
Reply-To: Jack Clark <jclark@HILLTOP.UMBC.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jack Clark <jclark@HILLTOP.UMBC.EDU>
Subject: Re: Agregation - Help on Code
In-Reply-To: A<3406_1317647744_4E89B57F_3406_12532_5_5AC182C88E20C64C915BB0E53B56B92616689EDF98@VCMT936CTO.corp1.rc.itau>
Content-Type: text/plain; charset="iso-8859-1"
Ricardo,
Messages in your SAS log likely would have pointed you to the fact that you are mixing character and numeric variable types. When you write VTG=.;, you are establishing VTG as a numeric variable in the data step. Then, when you try to assign it character values like 'Q1', 'Q2', etc, SAS does not like that.
If you want VTG to be a character variable, I would establish it with a LENGTH statement.
Length vtg $3; (assuming 3 characters is the widest value)
If you want to set it to missing, use VTG = ' ';
One other thing - in the last line before the RUN, you have VTG=Q11;. I am assuming it should read VTG='Q11'; (with quotes). The way you have it written, SAS will be trying to set VTG equal to the value of a variable called Q11.
Hope this helps.
Jack
Jack Clark
Senior Programmer
phone: 410-455-6256
fax: 410-455-6850
jclark@hilltop.umbc.edu
University of Maryland, Baltimore County
Sondheim Hall, 3rd Floor
1000 Hilltop Circle
Baltimore, MD 21250
Please consider the environment before printing this e-mail and/or any attachments.
Confidentiality Notice: This e-mail may contain information that is legally privileged and that is intended only for the use of the addressee(s) named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying of this e-mail, distribution, or action taken in reliance on the contents of this e-mail and/or documents attributed to this e-mail is strictly prohibited. If you have received this information in error, please notify the sender immediately by phone and delete this entire e-mail. Thank you.-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Ricardo Goncalves Silva
Sent: Monday, October 03, 2011 9:16 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Agregation - Help on Code
________________________________
Uso Interno. Observar critérios da circular Itaú AG-33.
________________________________
Hi, I wrote the following code to do an aggregation job. But doesn't run. Any help?
DATA LIB.DADOS_TRI;
SET LIB.BASE_PES_PJ_NC;
VTG=.;
IF VINTAGE IN (200708 200709 200710) THEN VTG='Q1';
IF VINTAGE IN (200711 200712 200801) THEN VTG='Q2';
IF VINTAGE IN (200802 200803 200804) THEN VTG='Q3';
IF VINTAGE IN (200805 200806 200807) THEN VTG='Q4';
IF VINTAGE IN (200808 200809 200810) THEN VTG='Q5';
IF VINTAGE IN (200811 200812 200901) THEN VTG='Q6';
IF VINTAGE IN (200902 200903 200904) THEN VTG='Q7';
IF VINTAGE IN (200905 200906 200907) THEN VTG='Q8';
IF VINTAGE IN (200908 200909 200910) THEN VTG='Q9';
IF VINTAGE IN (200911 200912 201001) THEN VTG='Q10';
IF VINTAGE IN (201002 201003) THEN VTG=Q11;
RUN;
Thanks, Rick.
"Esta mensagem e reservada e sua divulgacao, distribuicao, reproducao ou qualquer forma de uso e proibida e depende de previa autorizacao desta instituicao. O remetente utiliza o correio eletronico no exercicio do seu trabalho ou em razao dele, eximindo esta instituicao de qualquer responsabilidade por utilizacao indevida. Se voce recebeu esta mensagem por engano, favor elimina-la imediatamente."
"This message is reserved and its disclosure, distribution, reproduction or any other form of use is prohibited and shall depend upon previous proper authorization. The sender uses the electronic mail in the exercise of his/her work or by virtue thereof, and the institution accepts no liability for its undue use. If you have received this e-mail by mistake, please delete it immediately."