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;
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1434 views
  • 3 likes
  • 3 in conversation