Showing posts with label scan. Show all posts
Showing posts with label scan. Show all posts

Thursday, March 22, 2007

Cumulation of the data

%let name=200311+200312+200401+200402+200403+200404;

%let first_d=1031101+1031201+1040101+1040201+1040301+1040401;

%let last_d=1031201+1040101+1040201+1040301+1040401+1040501;
options mprint mlogic;

%macro peulot;

data nohesh.netunim_200311_200404;delete ;run;

%do i=1 %to 6;

proc sql;

connect to teradata

(user=xxx password=123 tdpid=DWPROD);

create table nohesh.peulot_%scan(&name,&i,+) as

select * from connection to teradata

(select branch_cust_ip,

count(*) as peulot

from bo_vall.V0500_1_FINANCIAL_EVENT as a,

bo_vall.VBM845_FINANCIAL_EVENT_CUST as b

where event_start_date ge %scan(&first_d,&i,+)

and event_start_date lt %scan(&last_d,&i,+)

and a.event_id=b.event_id

group by 1

);

disconnect from teradata;

quit;

data nohesh.netunim_200311_200404;

set nohesh.netunim_200311_200404

nohesh.peulot_%scan(&name,&i,+);

run;

%end;

%mend;

%peulot;

Friday, February 02, 2007

Export using scan

%let name=1+3+6+12;
%macro stam;
%do
i=1 %to 4;
data kim_%scan(&name,&i,+) ;
set kim;
if vetek=%scan(&name,&i,+)*1;
run;

PROC EXPORT DATA= kim_%scan(&name,&i,+)
OUTFILE= "\\c\kim_%scan(&name,&i,+).csv"
DBMS=CSV REPLACE;
RUN;
%end
;
%mend
;
%stam;