specifies the name of the value that the format is applied to.
specifies the name of the format.
specifies the input table that is used by the SAS_PUT( ) function.
options sqlmapputto=sas_put; libname dblib aster user="sas" password="sas" server="sl96208" database=sas connection=shared; /*-- Set SQL debug global options --*/ /*----------------------------------*/ options sastrace=',,,d' sastraceloc=saslog; /*-- Execute SQL using Implicit Passthru --*/ /*-----------------------------------------*/ proc sql noerrorstop; title1 'Test SAS_PUT using Implicit Passthru '; select distinct PUT(PRICE,Dollar8.2) AS PRICE_C from dblib.mailorderdemo; quit;
libname dblib aster user="sas" password="sas" server="sl96208" database=sas connection=shared; NOTE: Libref DBLIB was successfully assigned, as follows: Engine: ASTER Physical Name: sl96208 /*-- Set SQL debug global options --*/ /*----------------------------------*/ options sastrace=',,,d' sastraceloc=saslog; /*-- Execute SQL using Implicit Passthru --*/ /*-----------------------------------------*/ proc sql noerrorstop; title1 'Test SAS_PUT using Implicit Passthru '; select distinct PUT(PRICE,Dollar8.2) AS PRICE_C from dblib.mailorderdemo ; ASTER_0: Prepared: on connection 0 SELECT * FROM sas."mailorderdemo" ASTER_1: Prepared: on connection 0 select distinct cast(sas_put("sas"."mailorderdemo"."PRICE", 'DOLLAR8.2') as char(8)) as "PRICE_C" from "sas"."mailorderdemo" ASTER: trforc: COMMIT WORK ACCESS ENGINE: SQL statement was passed to the DBMS for fetching data. ASTER_2: Executed: on connection 0 select distinct cast(sas_put("sas"."mailorderdemo"."PRICE", 'DOLLAR8.2') as char(8)) as "PRICE_C" from "sas"."mailorderdemo" ASTER: trget - rows to fetch: 9 ASTER: trforc: COMMIT WORK Test SAS_PUT using Implicit Passthru 9 3:42 Thursday, April 25, 2012 PRICE_C _______ $8.00 $10.00 $12.00 $13.59 $13.99 $14.00 $27.98 $48.99 $54.00 quit;
proc sql noerrorstop; title1 'Test SAS_PUT using Explicit Passthru; connect to aster(user=sas password=XXX database=sas server=sl96208); select * from connection to aster (select distinct cast(sas_put("PRICE",'DOLLAR8.2') as char(8)) as "PRICE_C" from mailorderdemo); disconnect from aster; quit;
proc sql noerrorstop; title1 'Test SAS_PUT using Explicit Passthru '; connect to aster(user=sas password=XXX database=sas server=sl96208); select * from connection to aster (select distinct cast(sas_put("PRICE",'DOLLAR8.2') as char(8)) as "PRICE_C" from mailorderdemo); Test SAS_PUT using Explicit Passthru 10 13:42 Thursday, April 25, 2012 PRICE_C _______ $8.00 $10.00 $12.00 $13.59 $13.99 $14.00 $27.98 $48.99 $54.00 disconnect from aster; quit;
select distinct cast(sas_put("price", 'dollar8.2') as char(8)) as "price_c", cast(sas_put("date", 'date9.1') as char(9)) as "date_d", cast(sas_put("inv", 'best8.') as char(8)) as "inv_n", cast(sas_put("name", '$32.') as char(32)) as "name_n" from mailorderdemo;