How are you calling the sqlplus command? Can you share your script? Please wrap it in CODE tags. I fancy there is a flag required on the sqlplus call itself.
Please wrap your code fragments or data samples in code tags
Try this:-
sqlplus -s username/pwd@sid << EOF
exec pkgname(in parameter);
set echo off head off feed off pagesize 0 trimspool on linesize 1000
spool test_output.txt
select col1 || ',' || grp_cd from test;
spool off;
exit
EOF