BookmarkSubscribeRSS Feed
HeatherNewton
Quartz | Level 8

what does it mean when 1 is added after data statement? e.g. 

data apple 1;

  set template 1;

 

 

2 REPLIES 2
ballardw
Super User

Likely that the file was not actually code to execute and the 1 (or other numbers) are just a reference point.

 

When I run an example of that code with an existing data:

250  data apple 1;
                -
                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.

251
252    set sashelp.class;
253  run;

The first error means that the first 1 is not in an allowable code position.

Reeza
Super User

That isn't valid code and the 1 shouldn't be there. If you can add more context perhaps we can offer other details but as posted it's invalid code.

 

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 68         
 69         data class 1;
                       _
                       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.
 
 70         
 71           set sashelp.class 1;
                                _
                                22
                                200
 ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, CUROBS, END, INDSNAME, KEY, 
               KEYRESET, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.  
 
 ERROR 200-322: The symbol is not recognized and will be ignored.
 
 72         run;
 
 NOTE: The SAS System stopped processing this step because of errors.
 WARNING: The data set WORK.CLASS may be incomplete.  When this step was stopped there were 0 observations and 5 variables.
 WARNING: Data set WORK.CLASS was not replaced because this step was stopped.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       user cpu time       0.00 seconds
       system cpu time     0.00 seconds
       memory              639.46k
       OS Memory           26020.00k
       Timestamp           02/24/2022 02:12:03 AM
       Step Count                        30  Switch Count  0
       Page Faults                       0
       Page Reclaims                     75
       Page Swaps                        0
       Voluntary Context Switches        0
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           16
       

@HeatherNewton wrote:

what does it mean when 1 is added after data statement? e.g. 

data apple 1;

  set template 1;

 

 


 

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 751 views
  • 1 like
  • 3 in conversation