f



why is this warning(error) ??????????

Guys I am using SAS 8.2 version on windows xp platform , I am trying to do
something like this and I getting this warning in the Log can some body
explain me why and how to solve it

 proc sql ;
36   create table test
37      (customer char(4) ,
38       item char(10) ,
39       units num,
40       unitcost num(8,2));
NOTE: Table WORK.TEST created, with 0 rows and 4 columns.
41       label customer = 'Customer number '
WARNING: This SAS global statement is not supported in PROC SQL. It has been
ignored.
42               item = 'Item purchased '
43               units = '# Units purchased '
44               unitcost = 'Unit cost'
45       format unitcost  dollar12.2;
46   quit;
0
proccontents (843)
6/21/2006 3:46:02 AM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

7 Replies
1832 Views

Similar Articles

[PageSpeed] 8

You can't use label and format in PROC SQL.  Try the following code.

proc sql ;
create table test (
customer char(4) ,
item char(10) ,
units num,
unitcost num(8,2));
quit;

proc datasets lib=work;
 modify test;
 label 	customer = 'Customer number '
	item = 'Item purchased '
	units = '# Units purchased '
	unitcost = 'Unit cost' ;
 format unitcost  dollar12.2;
 run;
quit;

SAS_learner wrote:
> Guys I am using SAS 8.2 version on windows xp platform , I am trying to do
> something like this and I getting this warning in the Log can some body
> explain me why and how to solve it
>
>  proc sql ;
> 36   create table test
> 37      (customer char(4) ,
> 38       item char(10) ,
> 39       units num,
> 40       unitcost num(8,2));
> NOTE: Table WORK.TEST created, with 0 rows and 4 columns.
> 41       label customer = 'Customer number '
> WARNING: This SAS global statement is not supported in PROC SQL. It has been
> ignored.
> 42               item = 'Item purchased '
> 43               units = '# Units purchased '
> 44               unitcost = 'Unit cost'
> 45       format unitcost  dollar12.2;
> 46   quit;

0
davidschr (69)
6/21/2006 6:01:38 AM
the label and format statement is not supported in SQL. It looks a bit
different there. Try it like:

proc sql ;
   create table test
      (customer char(4) "Customer number",
       item char(10) "Item purchased",
       units num "# Units purchased",
      unitcost num(8,2) format=dollar12.2 "Unit cost");

   quit;





On Tue, 20 Jun 2006 23:46:02 -0400, SAS_learner <proccontents@GMAIL.COM> wrote:

>Guys I am using SAS 8.2 version on windows xp platform , I am trying to do
>something like this and I getting this warning in the Log can some body
>explain me why and how to solve it
>
> proc sql ;
>36   create table test
>37      (customer char(4) ,
>38       item char(10) ,
>39       units num,
>40       unitcost num(8,2));
>NOTE: Table WORK.TEST created, with 0 rows and 4 columns.
>41       label customer = 'Customer number '
>WARNING: This SAS global statement is not supported in PROC SQL. It has been
>ignored.
>42               item = 'Item purchased '
>43               units = '# Units purchased '
>44               unitcost = 'Unit cost'
>45       format unitcost  dollar12.2;
>46   quit;
0
ghellrieg (838)
6/21/2006 9:14:48 AM
David

* sure you can

proc sql ;
create table test
(cust char(12) label ='customer',
contdate num label='contact date' format=date7.);
insert into test
values ('Smith',88779);

proc print label noobs;

customer   contact date
Smith        26JAN03

* OR as an alternative

data one;
x=1;

proc sql;
select 'Smith' 'customer', 88779 'contact date' format=date7. from one;

customer   contact date
Smith          26JAN03



Erico


"SAS_learner" <proccontents@GMAIL.COM> wrote in message 
news:c2192a610606202046i1e7567a8ye33df8fac8a91c0d@mail.gmail.com...
> Guys I am using SAS 8.2 version on windows xp platform , I am trying to do
> something like this and I getting this warning in the Log can some body
> explain me why and how to solve it
>
> proc sql ;
> 36   create table test
> 37      (customer char(4) ,
> 38       item char(10) ,
> 39       units num,
> 40       unitcost num(8,2));
> NOTE: Table WORK.TEST created, with 0 rows and 4 columns.
> 41       label customer = 'Customer number '
> WARNING: This SAS global statement is not supported in PROC SQL. It has 
> been
> ignored.
> 42               item = 'Item purchased '
> 43               units = '# Units purchased '
> 44               unitcost = 'Unit cost'
> 45       format unitcost  dollar12.2;
> 46   quit; 


0
eeyre (54)
6/21/2006 10:01:45 AM
SAS_Learner ,

You can do what you want, Yes you can use a label statement as well as a
format statement.  Teo things you need to do, lose the parens and the
format.  Ther label and format statements are giving you the error, teh
particular construct of these you have choosen to use are not aplicable
within sql.  But SQl has its own constructs to achieve the same thing.

Try the following:


proc sql ;
create table test as <---- Need a 'as' here
Select Customer Format = $char4.    Label ='Customer number  '  ,
           Item       Format = $char10.  Label = 'Item purchased    '  ,
           units       Format = 8.           Label = '# Units purchased '  ,
           unitcost  Format = Dollar12.2 Label = 'Unit cost'
  From < you didnt have anything here but you need to refernece a data set>
;
quit ;



Toby Dunn





From: SAS_learner <proccontents@GMAIL.COM>
Reply-To: SAS_learner <proccontents@GMAIL.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: why is this warning(error) ??????????
Date: Tue, 20 Jun 2006 23:46:02 -0400

Guys I am using SAS 8.2 version on windows xp platform , I am trying to do
something like this and I getting this warning in the Log can some body
explain me why and how to solve it

proc sql ;
36   create table test
37      (customer char(4) ,
38       item char(10) ,
39       units num,
40       unitcost num(8,2));
NOTE: Table WORK.TEST created, with 0 rows and 4 columns.
41       label customer = 'Customer number '
WARNING: This SAS global statement is not supported in PROC SQL. It has been
ignored.
42               item = 'Item purchased '
43               units = '# Units purchased '
44               unitcost = 'Unit cost'
45       format unitcost  dollar12.2;
46   quit;
0
tobydunn (6020)
6/21/2006 1:37:06 PM
On Tue, 20 Jun 2006 23:46:02 -0400, SAS_learner <proccontents@GMAIL.COM> wrote:

>Guys I am using SAS 8.2 version on windows xp platform , I am trying to do
>something like this and I getting this warning in the Log can some body
>explain me why and how to solve it
>
> proc sql ;
>36   create table test
>37      (customer char(4) ,
>38       item char(10) ,
>39       units num,
>40       unitcost num(8,2));
>NOTE: Table WORK.TEST created, with 0 rows and 4 columns.
>41       label customer = 'Customer number '
>WARNING: This SAS global statement is not supported in PROC SQL. It has been
>ignored.

The what's and why's and workarounds have been covered.

I'm just surprised at the characterization of LABEL and FORMAT as *global
statements*, because they aren't, under my understanding of the term. They
have to be used within steps which support them.

>42               item = 'Item purchased '
>43               units = '# Units purchased '
>44               unitcost = 'Unit cost'
>45       format unitcost  dollar12.2;
>46   quit;
0
nospam1405 (4666)
6/22/2006 2:27:01 AM
I think that is a bit missleading. I assume, that in SQL environment all is
"local", what's before the ";". The rest might be kind of "global", but in
the SQL environment (between PROC SQL and QUIT).



On Wed, 21 Jun 2006 22:27:01 -0400, Howard Schreier <hs AT dc-sug DOT org>
<nospam@HOWLES.COM> wrote:

>On Tue, 20 Jun 2006 23:46:02 -0400, SAS_learner <proccontents@GMAIL.COM> wrote:
>
>>Guys I am using SAS 8.2 version on windows xp platform , I am trying to do
>>something like this and I getting this warning in the Log can some body
>>explain me why and how to solve it
>>
>> proc sql ;
>>36   create table test
>>37      (customer char(4) ,
>>38       item char(10) ,
>>39       units num,
>>40       unitcost num(8,2));
>>NOTE: Table WORK.TEST created, with 0 rows and 4 columns.
>>41       label customer = 'Customer number '
>>WARNING: This SAS global statement is not supported in PROC SQL. It has been
>>ignored.
>
>The what's and why's and workarounds have been covered.
>
>I'm just surprised at the characterization of LABEL and FORMAT as *global
>statements*, because they aren't, under my understanding of the term. They
>have to be used within steps which support them.
>
>>42               item = 'Item purchased '
>>43               units = '# Units purchased '
>>44               unitcost = 'Unit cost'
>>45       format unitcost  dollar12.2;
>>46   quit;
0
ghellrieg (838)
6/22/2006 10:51:25 AM
Howard ,

Go to the online docs, do a search for global statement.  click on the first
hit shold be "SAS(R) 9.1.3 Language Reference: Dictionary, Fifth Edition:
Statements" and you will see all of the global statements.  In that list
both format and label are there.



Toby Dunn





From: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Reply-To: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: why is this warning(error) ??????????
Date: Wed, 21 Jun 2006 22:27:01 -0400

On Tue, 20 Jun 2006 23:46:02 -0400, SAS_learner <proccontents@GMAIL.COM>
wrote:

 >Guys I am using SAS 8.2 version on windows xp platform , I am trying to do
 >something like this and I getting this warning in the Log can some body
 >explain me why and how to solve it
 >
 > proc sql ;
 >36   create table test
 >37      (customer char(4) ,
 >38       item char(10) ,
 >39       units num,
 >40       unitcost num(8,2));
 >NOTE: Table WORK.TEST created, with 0 rows and 4 columns.
 >41       label customer = 'Customer number '
 >WARNING: This SAS global statement is not supported in PROC SQL. It has
been
 >ignored.

The what's and why's and workarounds have been covered.

I'm just surprised at the characterization of LABEL and FORMAT as *global
statements*, because they aren't, under my understanding of the term. They
have to be used within steps which support them.

 >42               item = 'Item purchased '
 >43               units = '# Units purchased '
 >44               unitcost = 'Unit cost'
 >45       format unitcost  dollar12.2;
 >46   quit;
0
tobydunn (6020)
6/22/2006 1:11:17 PM
Reply: