Need help in select statetment

Dear Expert,

I have an table name (SMS) in which two column are there one "Flag" other is "Message", If my flag column consist of status "1" then output should be "welcome", else" try again" ,. please correct my code.

DECLARE 
c PLS_INTEGER := dbms_sql.open_cursor; 
flag VARCHAR2(50); 
STATEMENT VARCHAR2(255); 
BEGIN 
SELECT SUBSTR(flag, 1,2) 
INTO flag 
FROM xxx.sms; 
IF flag = 1 THEN 
dbms_output.put_line('welcome');
ELSE
dbms_output.put_line('ty again');
END IF;
END ;

Thank you,

set serveroutput on size 100000
DECLARE 

flag VARCHAR2(50); 
STATEMENT VARCHAR2(255); 

BEGIN 
  dbms_output.enable(100000);
 SELECT SUBSTR(flag, 1,2) 
   INTO flag 
 FROM xxx.sms; 
 IF flag = 1 THEN 
   dbms_output.put_line('welcome');
 ELSE
   dbms_output.put_line('try again');
 END IF;
END ;

Try that.