How to split pipe delimited file

I have a pipe delimited input file as below. First byte of the each line indicate the record type. Then i need to split the file based on record_type = null,0,1,2,6 and create 5 files. How do i do this in a ksh script? Pls help

|sl||SL|SL|SL|1996/04/03|1988/09/15|C|A|sl|||||
0|sl||AX||||SL|1973/04/01|1973/04/01|A|A|sl|||
|
1|sl|RCBH|OR||desc||sl||2008/04/16||A|novel||||RCBH||||||desc||||||
2|sl|SL|IA|02||desc||MPL||2008/04/16|A|A|novel|632||BUILDING|1 |N|MAIN|ST||1 N MAIN ST|||
|
6|sl|SL|FL|JD|U31||||||A|B|X|desc||clon8008||BT||2007/12/20|A|A|*|

awk '{  /^\// print $0 > "fileNULL";next
          /^0/ print $0 > "file0"; next
          /^1/  print $0 > "file1"; next
          /^2/ print $0 > "file2"; next
          /^6/ print $0 > "file6"; next
        }' hugefile
         

Another one, it creates the files with the names "file_null", "file_0", "file_1" etc.

awk -F"|" '{print $0 > ($1==""?"file_null":"file_"$1)}' file

Regards

Thanks Jim... i have used as you suggested,but getting below errors. I am very new to scripting... pls help

awk: syntax error near line 1
awk: illegal statement near line 1
awk: syntax error near line 2
awk: illegal statement near line 2
awk: syntax error near line 3
awk: illegal statement near line 3
awk: syntax error near line 4
awk: illegal statement near line 4
awk: syntax error near line 5
awk: illegal statement near line

/^\|/ {print $0 > "filenull"; next}
/^0/ {print $0 > "file0"; next}
/^1/ {print $0 > "file1"; next}
/^2/ {print $0 > "file2"; next}
/^6/ {print $0 > "file6"; next}