DATA Step, Macro, Functions and more

Help with SAS error "LIBNAME LAST IS NOT ASSIGNED."

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 104
Accepted Solution

Help with SAS error "LIBNAME LAST IS NOT ASSIGNED."

2          OPTIONS OBS=MAX LS=132 SORT=2000 SORTPGM=BEST NOSORTDEVWARN;         
3                                                                               
4           DATA LAST2.DATA;                                                    
 
5             SET LAST.DATA;                                                    
ERROR: LIBNAME LAST IS NOT ASSIGNED.                                            
ERROR: LIBNAME LAST IS NOT ASSIGNED.                                            
ERROR: LIBNAME LAST IS NOT ASSIGNED.                                            
6                                                                               
7               WHERE RISKIND = 'Y' AND DLTALLW > 0 AND MOS='2017-10' AND       
8                 MOP='2017-10';                                                
9             VSTCNT = 0;                                                       
10                                                                              
11            *- CALCULATE VISIT COUNT FOR ALLOWED LINES -*;                    
12                                                                              
13                                                                              
14              IF HOSOPSVC = '1' THEN DELETE;                                  
15              ELSE                                                            
16               DO;                                                            
17                IF SUBSTR(LTMATOS,2,1) IN ('G' 'B' 'M') THEN VSTCNT = 0;      
18                ELSE                                                          
19                IF ('90000' LE TMAPROC LE '90580' OR                          
20                   '90594' LE TMAPROC LE '90595' OR                           
21                    '90599' LE TMAPROC LE '92871' OR                          
22                    '92898' LE TMAPROC LE '94999' OR                          
23                    '95200' LE TMAPROC LE '97799' OR                          
24                    '98900' LE TMAPROC LE '98922' OR                          
25                    '99150' LE TMAPROC LE '99152' OR                          
26                    '99155' LE TMAPROC LE '99195' OR                          
27                    '99201' LE TMAPROC LE '99539' OR                          
28                    '99551' LE TMAPROC LE '99601' OR                          
29                     TMAPROC IN ('90590' '97810' '97813') )                   
30                     THEN DO;                                                 
31                            IF DLTSVCS > 99 THEN VSTCNT = 99;                 
32                            ELSE                                              
33                            VSTCNT = DLTSVCS;                                 
34                          END;                                                
35                   ELSE                                                       
36                    IF '95000' LE TMAPROC LE '95199' THEN VSTCNT = 1;         
37                    ELSE                                                      
38                    VSTCNT = 0;                                               
39                    OUTPUT NT06.DATA;                                         
                             _________                                          
                             _________                                          
                             _________                                          
                             455                                                
                             455                                                
                             455                                                
ERROR 455-185: DATA SET WAS NOT SPECIFIED ON THE DATA STATEMENT.                
ERROR 455-185: DATA SET WAS NOT SPECIFIED ON THE DATA STATEMENT.                
ERROR 455-185: DATA SET WAS NOT SPECIFIED ON THE DATA STATEMENT.                
                                                                                
40                   END;                                                       
41                  RUN;                                                        
                                                                                
NOTE: NUMERIC VALUES HAVE BEEN CONVERTED TO CHARACTER VALUES AT THE PLACES GIVEN
      17:18                                                                     
ERROR: LIBNAME LAST2 IS NOT ASSIGNED.                                           
ERROR: LIBNAME LAST2 IS NOT ASSIGNED.                                           
ERROR: LIBNAME LAST2 IS NOT ASSIGNED.                                           
3                                                          THE SAS SYSTEM       
                                                                                
NOTE: THE SAS SYSTEM STOPPED PROCESSING THIS STEP BECAUSE OF ERRORS.            
NOTE: SAS SET OPTION OBS=0 AND WILL CONTINUE TO CHECK STATEMENTS. THIS MAY CAUSE
NOTE: THE DATA STATEMENT USED 0.00 CPU SECONDS AND 13802K.                      
                                                                                
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 14260K ABO
                                                                                
                                                                                
42                                                                              
43              DATA CURR2.DATA;                                                
                         
44                SET CURR.DATA                                                 
45                                                                              
46           WHERE RISKIND = 'Y' AND DLTALLW > 0 AND MOS = '2017-10' AND MOP = '
                           _                 _                                  
                           _                 _                                  
                           _                 _                                  
                           22                22                                 
                           22                22                                 
                           22                22                                 
                             ___               _                                
                             ___               _                                
                             ___               _                                
                             200               200                              
                             200               200                              
                             200               200                              
                                               22                               
                                               22                               
                                               22                               
                                               76                               
                                               76                               
                                               76                               
ERROR 22-322: SYNTAX ERROR, EXPECTING ONE OF THE FOLLOWING: A NAME, A QUOTED STR
ERROR 22-322: SYNTAX ERROR, EXPECTING ONE OF THE FOLLOWING: A NAME, A QUOTED STR
ERROR 22-322: SYNTAX ERROR, EXPECTING ONE OF THE FOLLOWING: A NAME, A QUOTED STR
              _DATA_, _LAST_, _NULL_.                                           
              _DATA_, _LAST_, _NULL_.                                           
              _DATA_, _LAST_, _NULL_.                                           
                                                                                
ERROR 200-322: THE SYMBOL IS NOT RECOGNIZED AND WILL BE IGNORED.                
ERROR 200-322: THE SYMBOL IS NOT RECOGNIZED AND WILL BE IGNORED.                
ERROR 200-322: THE SYMBOL IS NOT RECOGNIZED AND WILL BE IGNORED.                
                                                                                
ERROR 76-322: SYNTAX ERROR, STATEMENT WILL BE IGNORED.                          
ERROR 76-322: SYNTAX ERROR, STATEMENT WILL BE IGNORED.                          
ERROR 76-322: SYNTAX ERROR, STATEMENT WILL BE IGNORED.                          
                                                                                
47                                                                              
48            VSTCNT = 0;                                                       
49                                                                              
50             *- CALCULATE VISIT COUNT FOR ALLOWED LINES -*;                   
WARNING: THE QUOTED STRING CURRENTLY BEING PROCESSED HAS BECOME MORE THAN 262 CH
         MARKS.                                                                 
46           WHERE RISKIND = 'Y' AND DLTALLW > 0 AND MOS = '2017-10' AND MOP = '
                                                                               _
                                                                               _
                                                                               _
                                                                               4
                                                                               4
                                                                               4

Accepted Solutions
Solution
‎12-07-2017 01:10 PM
Super User
Posts: 13,293

Re: Help with SAS error "LIBNAME LAST IS NOT ASSIGNED."

Very clear error: you do not currently have a library named LAST assigned.

Since you are creating LAST2.data that library apparently exists though you have additional errors of

OUTPUT NT06.DATA which requires NTO6.Data to be on the DATA statement.

 

Also

44                SET CURR.DATA                                                 
45                                                                              
46           WHERE RISKIND = 'Y' AND DLTALLW > 0 AND MOS = '2017-10' AND MOP = '

is an error because you either do not have a ; after Set curr.data; OR you intended a data set option which would require the where bit inside () and slightly different syntax.

 

 

What ever you are attempting with the MOP= bit it is having problems in the curr2.data.

 

I think you may be partially misunderstanding the purpose of library and data set names. Library generally relates to a common storage location often for a specific project or commonality of use with differently named data sets for specificity. Every one of your data sets is named "data" and in a different library reference. Perhaps you are intending NOT to have the period and refer to Last2Data, LastData or similar.

View solution in original post


All Replies
Super User
Posts: 23,235

Re: Help with SAS error "LIBNAME LAST IS NOT ASSIGNED."

Well...where is the LIBNAME statement? Should it be in your code? Is it a default library that should have been set up and isn't' for some reason?

 


essdee wrote:
2          OPTIONS OBS=MAX LS=132 SORT=2000 SORTPGM=BEST NOSORTDEVWARN;         
3                                                                               
4           DATA LAST2.DATA;                                                    
 
5             SET LAST.DATA;                                                    
ERROR: LIBNAME LAST IS NOT ASSIGNED.                                            
ERROR: LIBNAME LAST IS NOT ASSIGNED.                                            
ERROR: LIBNAME LAST IS NOT ASSIGNED.                                            
6                                                                               
7               WHERE RISKIND = 'Y' AND DLTALLW > 0 AND MOS='2017-10' AND       
8                 MOP='2017-10';                                                
9             VSTCNT = 0;                                                       
10                                                                              
11            *- CALCULATE VISIT COUNT FOR ALLOWED LINES -*;                    
12                                                                              
13                                                                              
14              IF HOSOPSVC = '1' THEN DELETE;                                  
15              ELSE                                                            
16               DO;                                                            
17                IF SUBSTR(LTMATOS,2,1) IN ('G' 'B' 'M') THEN VSTCNT = 0;      
18                ELSE                                                          
19                IF ('90000' LE TMAPROC LE '90580' OR                          
20                   '90594' LE TMAPROC LE '90595' OR                           
21                    '90599' LE TMAPROC LE '92871' OR                          
22                    '92898' LE TMAPROC LE '94999' OR                          
23                    '95200' LE TMAPROC LE '97799' OR                          
24                    '98900' LE TMAPROC LE '98922' OR                          
25                    '99150' LE TMAPROC LE '99152' OR                          
26                    '99155' LE TMAPROC LE '99195' OR                          
27                    '99201' LE TMAPROC LE '99539' OR                          
28                    '99551' LE TMAPROC LE '99601' OR                          
29                     TMAPROC IN ('90590' '97810' '97813') )                   
30                     THEN DO;                                                 
31                            IF DLTSVCS > 99 THEN VSTCNT = 99;                 
32                            ELSE                                              
33                            VSTCNT = DLTSVCS;                                 
34                          END;                                                
35                   ELSE                                                       
36                    IF '95000' LE TMAPROC LE '95199' THEN VSTCNT = 1;         
37                    ELSE                                                      
38                    VSTCNT = 0;                                               
39                    OUTPUT NT06.DATA;                                         
                             _________                                          
                             _________                                          
                             _________                                          
                             455                                                
                             455                                                
                             455                                                
ERROR 455-185: DATA SET WAS NOT SPECIFIED ON THE DATA STATEMENT.                
ERROR 455-185: DATA SET WAS NOT SPECIFIED ON THE DATA STATEMENT.                
ERROR 455-185: DATA SET WAS NOT SPECIFIED ON THE DATA STATEMENT.                
                                                                                
40                   END;                                                       
41                  RUN;                                                        
                                                                                
NOTE: NUMERIC VALUES HAVE BEEN CONVERTED TO CHARACTER VALUES AT THE PLACES GIVEN
      17:18                                                                     
ERROR: LIBNAME LAST2 IS NOT ASSIGNED.                                           
ERROR: LIBNAME LAST2 IS NOT ASSIGNED.                                           
ERROR: LIBNAME LAST2 IS NOT ASSIGNED.                                           
3                                                          THE SAS SYSTEM       
                                                                                
NOTE: THE SAS SYSTEM STOPPED PROCESSING THIS STEP BECAUSE OF ERRORS.            
NOTE: SAS SET OPTION OBS=0 AND WILL CONTINUE TO CHECK STATEMENTS. THIS MAY CAUSE
NOTE: THE DATA STATEMENT USED 0.00 CPU SECONDS AND 13802K.                      
                                                                                
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 636K BELOW THE LINE AND 14260K ABO
                                                                                
                                                                                
42                                                                              
43              DATA CURR2.DATA;                                                
                         
44                SET CURR.DATA                                                 
45                                                                              
46           WHERE RISKIND = 'Y' AND DLTALLW > 0 AND MOS = '2017-10' AND MOP = '
                           _                 _                                  
                           _                 _                                  
                           _                 _                                  
                           22                22                                 
                           22                22                                 
                           22                22                                 
                             ___               _                                
                             ___               _                                
                             ___               _                                
                             200               200                              
                             200               200                              
                             200               200                              
                                               22                               
                                               22                               
                                               22                               
                                               76                               
                                               76                               
                                               76                               
ERROR 22-322: SYNTAX ERROR, EXPECTING ONE OF THE FOLLOWING: A NAME, A QUOTED STR
ERROR 22-322: SYNTAX ERROR, EXPECTING ONE OF THE FOLLOWING: A NAME, A QUOTED STR
ERROR 22-322: SYNTAX ERROR, EXPECTING ONE OF THE FOLLOWING: A NAME, A QUOTED STR
              _DATA_, _LAST_, _NULL_.                                           
              _DATA_, _LAST_, _NULL_.                                           
              _DATA_, _LAST_, _NULL_.                                           
                                                                                
ERROR 200-322: THE SYMBOL IS NOT RECOGNIZED AND WILL BE IGNORED.                
ERROR 200-322: THE SYMBOL IS NOT RECOGNIZED AND WILL BE IGNORED.                
ERROR 200-322: THE SYMBOL IS NOT RECOGNIZED AND WILL BE IGNORED.                
                                                                                
ERROR 76-322: SYNTAX ERROR, STATEMENT WILL BE IGNORED.                          
ERROR 76-322: SYNTAX ERROR, STATEMENT WILL BE IGNORED.                          
ERROR 76-322: SYNTAX ERROR, STATEMENT WILL BE IGNORED.                          
                                                                                
47                                                                              
48            VSTCNT = 0;                                                       
49                                                                              
50             *- CALCULATE VISIT COUNT FOR ALLOWED LINES -*;                   
WARNING: THE QUOTED STRING CURRENTLY BEING PROCESSED HAS BECOME MORE THAN 262 CH
         MARKS.                                                                 
46           WHERE RISKIND = 'Y' AND DLTALLW > 0 AND MOS = '2017-10' AND MOP = '
                                                                               _
                                                                               _
                                                                               _
                                                                               4
                                                                               4
                                                                               4

 

Solution
‎12-07-2017 01:10 PM
Super User
Posts: 13,293

Re: Help with SAS error "LIBNAME LAST IS NOT ASSIGNED."

Very clear error: you do not currently have a library named LAST assigned.

Since you are creating LAST2.data that library apparently exists though you have additional errors of

OUTPUT NT06.DATA which requires NTO6.Data to be on the DATA statement.

 

Also

44                SET CURR.DATA                                                 
45                                                                              
46           WHERE RISKIND = 'Y' AND DLTALLW > 0 AND MOS = '2017-10' AND MOP = '

is an error because you either do not have a ; after Set curr.data; OR you intended a data set option which would require the where bit inside () and slightly different syntax.

 

 

What ever you are attempting with the MOP= bit it is having problems in the curr2.data.

 

I think you may be partially misunderstanding the purpose of library and data set names. Library generally relates to a common storage location often for a specific project or commonality of use with differently named data sets for specificity. Every one of your data sets is named "data" and in a different library reference. Perhaps you are intending NOT to have the period and refer to Last2Data, LastData or similar.

Frequent Contributor
Posts: 104

Re: Help with SAS error "LIBNAME LAST IS NOT ASSIGNED."

I fixed the error - I didn't define the data sets in the jcl

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 117 views
  • 0 likes
  • 3 in conversation