Desktop productivity for business analysts and programmers

Error generating subroutine

Reply
Contributor
Posts: 28

Error generating subroutine

Hi Team,

 

I am extracting data from a table where in I would like to extract data for so many materials and few conditions in place. Syntactically it is correct, but somehow I am receiving the below error:

 

ERROR:  Error generating subroutine at line: 154. List elements that take up more than one line are not allowed - Word: OPEN       
               . Offset:  1 .

 

Please help...!

 

Thanks in advance..!

Sandy

Super User
Posts: 9,574

Re: Error generating subroutine

Posted in reply to sandykota

Please post the whole log of the step in a {i} window.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Contributor
Posts: 28

Re: Error generating subroutine

[ Edited ]
Posted in reply to KurtBremser

Hi Kurt,

 

Posting the below log:

1                                                          The SAS System                                 11:14 Friday, May 11, 2018

1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET _CLIENTTASKLABEL='Program';
4          %LET _CLIENTPROJECTPATH='';
5          %LET _CLIENTPROJECTNAME='';
6          %LET _SASPROGRAMFILE=;
7          
8          ODS _ALL_ CLOSE;
9          OPTIONS DEV=ACTIVEX;
10         GOPTIONS XPIXELS=0 YPIXELS=0;
11         FILENAME EGSR TEMP;
12         ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR STYLE=HtmlBlue
12       ! STYLESHEET=(URL="file:///C:/Program%20Files/SASHome/SASEnterpriseGuide/5.1/Styles/HtmlBlue.css") NOGTITLE NOGFOOTNOTE
12       ! GPATH=&sasworklocation ENCODING=UTF8 options(rolap="on");
NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
13         
14         GOPTIONS ACCESSIBLE;
15         LIBNAME SAPLib SASIOSR3  ashost=XXXXXX sysnr=15  BatchMode=1  trace=0  language=EN  Client=900
16         AUTHDOMAIN="SAPAuthPROD" ;
NOTE: Libref YYYYY was successfully assigned as follows: 
      Engine:        R3 
      Physical Name: XXXXXX
17         


18         proc sql;
19         create table test as
20         select
21         a.A1
22         a.A2,
23         a.A3,
24         a.A4,
25         a.A5Y,
26         
27         
28         from XXXX."TABLE"n as a
29         where a.A1>= '01apr2017'd and a.A1<'01feb2018'd
30         and a."A2"n IN ('000000000X1','000000000X2','00000000X3')
201        and a."A3"n = 'H'
202        and a."A4"n IN ('101','102','641','642');
ERROR:  Error generating subroutine at line: 154. List elements that take up more than one line are not allowed - Word: OPEN        
               . Offset:  1 .

NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
203        quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.20 seconds
      cpu time            0.03 seconds
      
204        
205        
206        GOPTIONS NOACCESSIBLE;
207        %LET _CLIENTTASKLABEL=;
208        %LET _CLIENTPROJECTPATH=;
209        %LET _CLIENTPROJECTNAME=;
210        %LET _SASPROGRAMFILE=;
211        
212        ;*';*";*/;quit;run;
213        ODS _ALL_ CLOSE;
214        
215        
5                                                          The SAS System                                 11:14 Friday, May 11, 2018

216        QUIT; RUN;
217        

 

Super User
Posts: 9,574

Re: Error generating subroutine

Posted in reply to sandykota

Lines 31 to 200 are missing, and the most interesting line (154) is in there. Do you have an option active that suppresses log output, or did you just miss to copy that part?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Contributor
Posts: 28

Re: Error generating subroutine

Posted in reply to KurtBremser

Hi,

 

In my earlier thread please refer to line no 30 where in 3 materials have been given as sample. There are almost 150 materials which may be confusing so I kept that 3 products as reference.

Super User
Posts: 13,040

Re: Error generating subroutine

Posted in reply to sandykota

@sandykota wrote:

Hi,

 

In my earlier thread please refer to line no 30 where in 3 materials have been given as sample. There are almost 150 materials which may be confusing so I kept that 3 products as reference.


If you do not reference another post we don't know that is needed or even which one it is.

 

Since the error message is:

ERROR:  Error generating subroutine at line: 154. List elements that take up more than one line are not allowed - Word: OPEN        

That sounds like you have 150 items taking up a largish number of lines for single(?) in . Which the error is telling you is not valid.

 

Contributor
Posts: 28

Re: Error generating subroutine

Hi @ballardw,

 

Thanks for your reply..!

 

I am new to SAS programming and could you please tell me the procedure to extract multiple products.

 

For example: I have a column called "Product" and in which multiple products data will be there. But I would like to extract only for specific products.

 

If my product is in this format "0000000000xxxxxxxx" which means that 10 zeros followed by material number. I am using IN operator and I m getting into error

 

Product IN ('0000000000xxxxxxxx','00000000000xxxxxxx1','0000000000xxxxxxx2',0000000000xxxxxxx3'.......................................'0000000000xxxxx150')

 

. If I specify one material to extract output is coming

 

Product = '0000000000xxxxxxxx'

 

. Please help...!

 

 

Ask a Question
Discussion stats
  • 6 replies
  • 163 views
  • 0 likes
  • 3 in conversation