Hi:
Notice the difference between where I have my options statement to turn the option on and off and where you put the statement in your code. It does make a difference. Your 2nd option statement essentially cancelled out the 1st option statement because they were both within the boundary of the step. A good rule of thumb is to place the option statement to turn OFF regular by line processing BEFORE Proc Report starts to execute; and to place the option statement to turn ON the regular processing AFTER Proc Report finishes executing (after the step boundary).
Since you are executing this as a stored process, however, you would want to run the option right after %stpbegin (then the setting will override any by line option set inside %stpbegin):[pre]
*ProcessBody;
%stpbegin;
options nobyline;
proc report ...;
...more code;
run;
%stpend;
[/pre]
If you do not have any other steps that require by line default processing, then you can leave off the option byline statement at the end of the code. (you have yours before the RUN). In fact, it is this last option byline that caused your trouble.
Think of the options statement, like the title statement, as being "pulled out" of your code and executed first. The 1st option statement was cancelled out by the 2nd option statement. Just like if you did this:
[pre]
proc report data=sashelp.shoes nowd;
title 'one fish, two fish';
column product sales;
title 'red fish, blue fish';
run;
[/pre]
The -effective- title would be 'red fish, blue fish' -- because the second title statement would override the first title statement. In order to avoid this accidental collision, I generally follow the scheme where all my option statements stay outside of step boundaries and my title and footnote statements are the only global-type statements that I will put inside procedure code.
cynthia