Search Results

442 résultats trouvés Page 37 / 45
Code SAS
Voir

Stop Losing Your PROC CAS Output: Master the SAVERESULT Statement

/* Démarre une session CAS */ proc cas; session casauto; caslib _all_ assign; /* Charge le jeu de données iris de SASHELP dans CAS */ table.loadtable / caslib='casuser', path='Iris.sashdat', casout={name='iris_cas', replace=true}; /* Crée une table fi...

Code SAS
Voir

Stop Overwriting Your Data: How to Perform In-Place Updates with table.update

data mycas.produits; length NomProduit $30 Categorie $20 Statut $10; input NomProduit Categorie Prix Statut $; datalines; Ordinateur Portable Electronique 1200 EnStock Smartphone Electronique 800 EnStock Souris Accessoire 25 EnStock Clavier Accessoire 75 Rupture Ecran Electronique 300...

Code SAS
Voir

Stop Overwriting Your Data: How to Perform In-Place Updates with table.update

proc cas; session casauto; table.update / table='produits', where="Statut = 'Rupture'", set={ {var='Prix', value='Prix * 0.90'}, {var='Statut', value="'EnStock'"} }; table.fetch / table='produits'; quit;

Code SAS
Voir

Stop Overwriting Your Data: How to Perform In-Place Updates with table.update

%let CATEGORIE_CIBLE = 'Electronique'; %let POURCENTAGE_AUGMENTATION = 1.15; proc cas; session casauto; table.update / table='produits', where="Categorie = &CATEGORIE_CIBLE.", set={ {var='Prix', value="Prix * &POURCENTAGE_AUGMENTATION."}, {var='NomProd...

Code SAS
Voir

Stop Overwriting Your Data: How to Perform In-Place Updates with table.update

data mycas.stock_produits; length NomProduit $30 Stock Initial $10; input NomProduit Stock $; datalines; Ordinateur Portable 10 Smartphone 50 Souris 200 Clavier 0 Ecran 30 Tablette 5 ; run; proc cas; session casauto; table.promote / caslib='mycas' name='stock_produits'; ...

Code SAS
Voir

From Raw CSV to Formatted Table: The Efficient Way to Load Local Data to CAS

/* Création du fichier CSV local */ DATA _NULL_; FILE "/tmp/myusage_basic.csv" DSD LRECL=200; PUT 'account,high,low,recorddt,startdt,enddt,kwh'; PUT '1000001,82,71,07/03/2013,07/01/2013,07/02/2013,54'; PUT '1000001,85,70,07/02/2013,06/30/2013,07/01/2013,70'; PUT '1000001,85,68,07/01/201...

Code SAS
Voir

From Raw CSV to Formatted Table: The Efficient Way to Load Local Data to CAS

/* Création du fichier CSV local avec plus de données */ DATA _NULL_; FILE "/tmp/myusage_inter.csv" DSD LRECL=200; PUT 'account,high,low,recorddt,startdt,enddt,kwh,cost'; PUT '1000001,82,71,07/03/2013,07/01/2013,07/02/2013,54,12.50'; PUT '1000001,85,70,07/02/2013,06/30/2013,07/01/2013,70,...

Code SAS
Voir

From Raw CSV to Formatted Table: The Efficient Way to Load Local Data to CAS

/* Création du fichier CSV local */ %LET CSV_FILE = /tmp/mydata_advanced_&sysdate._%sysfunc(compress(&systime.)).csv; %LET CAS_TABLE = mydata_advanced; %LET CAS_LIB = CASUSER; DATA _NULL_; FILE "&CSV_FILE" DSD LRECL=200; PUT 'ID,Category,Value,EntryDate'; PUT '1,A,123.45,12-JAN-2023'; PU...

Code SAS
Voir

From Raw CSV to Formatted Table: The Efficient Way to Load Local Data to CAS

/* Création du fichier CSV local */ DATA _NULL_; FILE "/tmp/transactions.csv" DSD LRECL=200; PUT 'TransactionID,CustomerID,Amount,TransactionDate,ProductCode'; PUT '1,C001,150.75,2023-01-15,PROD001'; PUT '2,C002,230.00,2023-01-16,PROD002'; PUT '3,C001,50.25,2023-01-15,PROD003'; PUT '4...

Code SAS
Voir

No Data Step Required: Creating Computed Columns on the Fly with table.fetch

/* Création d'une table de démonstration en mémoire CAS */ data casuser.ma_table; input ID Nom $ Age Score; datalines; 1 Alice 25 85 2 Bob 30 92 3 Charlie 22 78 4 Diana 28 95 5 Eve 35 88 ; run; proc cas; session casauto; /* Afficher les 3 premières lignes de la table */ table...