BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Arun_shSAS
Fluorite | Level 6
data 123111a;
set sashelp.class;
run;

I just ran a simple program just to check the different steps of the compilation phase. It clearly says that once  the compilation phase complete then it go to next step to create descriptor portion of the dataset as clearly there is a syntax error then why is creationg dataset and creation descriptor portion of the dataset. 

 

https://onlinecourses.science.psu.edu/stat480/node/58/

 

 

image.png

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

HI,

That online course is NOT our course. When we teach about the DATA step and the compile phase versus execution, we teach that the descriptor portion of the new data set is created during the compile phase. As a references, please see this documentation site:

https://go.documentation.sas.com/?docsetId=basess&docsetTarget=n053a58fwk57v7n14h8x7y7u34y4.htm&docs... and the lovely chart there that clearly shows the PDV, the descriptor portion of the dataset and/or an input buffer, if necessary.

 

For example, if you have a DATA step, but no INFILE or INPUT statements, then an INPUT buffer is not created. If you have a DATA _NULL_ step, then a descriptor portion is not created.

 

Here's the chart...for a bigger version, visit the web site:

 

compile_phase.png

 

  I hope this helps clarify what happens at compile time.

Cynthia

View solution in original post

7 REPLIES 7
PeterClemmensen
Tourmaline | Level 20

I'm not entirely sure what the question is here. But yes, while compiling, the data step checks naming conventions and so on. The reason your data step here fails is that a SAS data set can not start with a number.

 

 

Arun_shSAS
Fluorite | Level 6

But the dataset is created with no obs with all the fields that set statement has. 

PeterClemmensen
Tourmaline | Level 20

For a well explained and thorough description of data step processing, I usually recommend the SAS Programming 1: Essentials E-Learning course. It is a free online course provided by SAS.

Arun_shSAS
Fluorite | Level 6

I am experienced into SAS. I was just curious to see why dataset is being created and also descriptor portion is also created when syntax error is there.

 

 

 

Cynthia_sas
SAS Super FREQ

HI,

That online course is NOT our course. When we teach about the DATA step and the compile phase versus execution, we teach that the descriptor portion of the new data set is created during the compile phase. As a references, please see this documentation site:

https://go.documentation.sas.com/?docsetId=basess&docsetTarget=n053a58fwk57v7n14h8x7y7u34y4.htm&docs... and the lovely chart there that clearly shows the PDV, the descriptor portion of the dataset and/or an input buffer, if necessary.

 

For example, if you have a DATA step, but no INFILE or INPUT statements, then an INPUT buffer is not created. If you have a DATA _NULL_ step, then a descriptor portion is not created.

 

Here's the chart...for a bigger version, visit the web site:

 

compile_phase.png

 

  I hope this helps clarify what happens at compile time.

Cynthia

Arun_shSAS
Fluorite | Level 6

Hi Cynthia, 

 

Thanks, for replying. 

 

The thing was that is not clear to me that there is an syntax error i.e dataset name should not start with a # and sas by default create a dataset with name a also create a descriptor portion (which is usually done first phase of compilation phase after syntax checking) 

data 123a;
set sashelp.class;
run;
Tom
Super User Tom
Super User

Not sure if you can make any projection of how it would work without an error from what it does when there is an error.

It appears that it is ignoring the leading digits.  Try adding a space before the letter A and you will get the same. Or if you remove the letter A then it will create DATA1 (or whatever number comes next) just as if you had left the name empty.

 

Note that the second error message clearly states it is ignoring the digits, hence it is interpreting A as the name of the dataset you wanted to created.

 

1250  data 123a;
           ---
           22
           200
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, /, ;, _DATA_,
              _LAST_, _NULL_.

ERROR 200-322: The symbol is not recognized and will be ignored.

1251  set sashelp.class;
1252  run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.A may be incomplete.  When this step was stopped there were 0
         observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.26 seconds
      cpu time            0.01 seconds


1253  data 123;
           ---
           22
           200
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, /, ;, _DATA_,
              _LAST_, _NULL_.

ERROR 200-322: The symbol is not recognized and will be ignored.

1254  set sashelp.class;
1255  run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.DATA1 may be incomplete.  When this step was stopped there were 0
         observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.19 seconds
      cpu time            0.01 seconds

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 949 views
  • 0 likes
  • 4 in conversation