BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
wmueller
Fluorite | Level 6

Hi everybody,

although a similar question was on this community. I get similar problems with this code:

 

-----8<--------------

DATA Temp;
infile datalines delimiter=',';
format ITEM1 $40. ITEM2 $38.;
INPUT ITEM1 $ ITEM2 $;
datalines;
1000,A
2000,B
3000,C
;
run;

data test;
set Temp;
select (_N_);
when (1) put 'First!';
otherwise put 'Not first!';
run;

----->8--------------

 

The logfile is as follows:

----------8<------------

 

1 The SAS System 21:57 Thursday, January 14, 2016

1 ;*';*";*/;quit;run;
2 OPTIONS PAGENO=MIN;
3 %LET _CLIENTTASKLABEL='SELECT_OTHERWISE1';
4 %LET _CLIENTPROJECTPATH='F:\8_SAS_Wiki\31_SAS_Syntax_Beispiele\SAS_Syntax.egp';
5 %LET _CLIENTPROJECTNAME='SAS_Syntax.egp';
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
13 STYLE=HtmlBlue
14 STYLESHEET=(URL="file:///C:/Program%20Files/SASHome/SASEnterpriseGuide/6.1/Styles/HtmlBlue.css")
15 NOGTITLE
16 NOGFOOTNOTE
17 GPATH=&sasworklocation
18 ENCODING=UTF8
19 options(rolap="on")
20 ;
NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
21
22 GOPTIONS ACCESSIBLE;
23 DATA Temp;
24 infile datalines delimiter=',';
25 format ITEM1 $40. ITEM2 $38.;
26 INPUT ITEM1 $ ITEM2 $;
27 datalines;

NOTE: The data set WORK.TEMP has 3 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds

31 ;

32 run;
33
34 data test;
35 set Temp;
36 put _N_;
37 select (_N_);
38 when (1) put 'First!';
39 otherwise put 'Not first!';
40 run;

40 run;
_
117
ERROR 117-185: There was 1 unclosed SELECT block.

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.TEST may be incomplete. When this step was stopped there were 0 observations and 2 variables.
WARNING: Data set WORK.TEST was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

 

2 The SAS System 21:57 Thursday, January 14, 2016


41
42
43 GOPTIONS NOACCESSIBLE;
44 %LET _CLIENTTASKLABEL=;
45 %LET _CLIENTPROJECTPATH=;
46 %LET _CLIENTPROJECTNAME=;
47 %LET _SASPROGRAMFILE=;
48
49 ;*';*";*/;quit;run;
50 ODS _ALL_ CLOSE;
51
52
53 QUIT; RUN;
54

----------8<------------

 

What is going wrong?

 

Best regards

wmueller

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
3 REPLIES 3
LinusH
Tourmaline | Level 20

end;?

Data never sleeps
wmueller
Fluorite | Level 6

Ooops. So simple and elegant. Pardon me.

 

 

ChrisHemedinger
Community Manager

@LinusH is correct.  Specifically:

 

DATA Temp;
    infile datalines delimiter=',';
    format ITEM1 $40. ITEM2 $38.;
    INPUT ITEM1 $ ITEM2 $;
    datalines;
1000,A
2000,B
3000,C
;
run;

data test;
    set Temp;
    select (_N_);
        when (1) put 'First!';
        otherwise put 'Not first!';
    end; /* THIS end was missing */
run;
SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 3 replies
  • 2230 views
  • 3 likes
  • 3 in conversation