Précédent   Forum des professionnels en informatique > Logiciels > Solutions d'entreprise > Business Intelligence > SAS > SAS Base
SAS Base Forum d'entraide sur SAS base : étape data, procédures non statistiques, procédures non graphiques, SQL
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 06/09/2011, 16h09   #1
Invité de passage
 
Femme
Chargé d'affaire
Inscription : septembre 2011
Messages : 10
Détails du profil
Informations personnelles :
Sexe : Femme

Informations professionnelles :
Activité : Chargé d'affaire
Secteur : Finance

Informations forums :
Inscription : septembre 2011
Messages : 10
Points : 1
Points : 1
Par défaut Automatiser programme générant des dates avec un array

Bonjour,

voici un programme tout basique qui fonctionne :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
DATA m2 ; 
        SET maxaut1(keep = contrat compagnie produit marque immat date_effet date_resil lib_avt prim_ttc rannee rmois);
WHERE rannee="2011" AND rmois="5";
format  x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 ddmmyy10.;
       x1=intnx('month',date_effet,0);
    x2=intnx('month',date_effet,1);
    x3=intnx('month',date_effet,2);
    x4=intnx('month',date_effet,3);
    x5=intnx('month',date_effet,4);
    x6=intnx('month',date_effet,5);
    x7=intnx('month',date_effet,6);
    x8=intnx('month',date_effet,7);
    x9=intnx('month',date_effet,8);
    x10=intnx('month',date_effet,9);
    x11=intnx('month',date_effet,10);
    x12=intnx('month',date_effet,11);
 
    run;
j'essaie de l'automatiser avec des array et je bloque complètement ,

Code :
1
2
3
4
5
DATA array3; SET maxaut2;
 
    array bord b1-b36 ;
    do i=1 TO 36;
    bord(i)=mdy(

quelqu'un peut il m'aider a me sortir de ce binzzzzz.



j'ai le même problème avec le programme suivant :


Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
DATA test2; SET test;
format     bord012010 bord022010 bord032010 bord042010 bord052010 bord062010         bord072010 bord082010 bord092010 bord102010 bord112010 bord122010          ddmmyy10.;
      bord012010=mdy(01,01,2010);
  bord022010=mdy(02,01,2010);
  bord032010=mdy(03,01,2010);
  bord042010=mdy(04,01,2010);
  bord052010=mdy(05,01,2010);
  bord062010=mdy(06,01,2010);
  bord072010=mdy(07,01,2010);
  bord082010=mdy(08,01,2010);
  bord092010=mdy(09,01,2010);
  bord102010=mdy(10,01,2010);
  bord112010=mdy(11,01,2010);
  bord122010=mdy(12,01,2010);
  run;
je ne sais pas non plus l'automatiser.
jobhocus est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 07/09/2011, 15h46   #2
Membre du Club
 
Inscription : décembre 2009
Messages : 37
Détails du profil
Informations forums :
Inscription : décembre 2009
Messages : 37
Points : 43
Points : 43
tu peux tester avec ceci :

Code :
1
2
3
4
5
6
7
8
9
10
11
 
DATA m2 ; 
SET maxaut1(keep = contrat compagnie produit marque immat date_effet date_resil lib_avt prim_ttc rannee rmois);
WHERE rannee="2011" AND rmois="5";
array x(12) 8.;
format x1-x12 ddmmyy10.;
do i=1 TO 12;
 x(i)=intnx('month',date_effet,i-1);
end;
DROP i;
run;
richie_leffe est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 22h02.


 
 
 
 
Partenaires

Hébergement Web