You only learn it by solving it yourself - or at least invest some time trying to find out.
You'll find everything in the Online Doc and there are normally also examples.
But let's assume you waited too long before starting with work....
length newvar $ 10;
do i=1 to length(var) while(scan(var,i,'|') ne '' );
proc print data=want;