$ if (P1 .eqs. "")
$ then
$ write sys$output "Extraction Fields Not Entered
$ write sys$output "Usage: @fext 1:10 20:3 30:5 10:7 etc..
$ write sys$output "    Maximum is 8 parameters on the command line
$ goto endit
$ else
$    fstring = P1
$ endif

$ if (P2 .eqs. "")
$ then
$ else
$ fstring = P1+" "+P2
$ endif

$ if (P3 .eqs. "")
$ then
$ else
$ fstring = P1+" "+P2+" "+P3
$ endif

$ if (P4 .eqs. "")
$ then
$ else
$ fstring = P1+" "+P2+" "+P3+" "+P4
$ endif

$ if (P5 .eqs. "")
$ then
$ else
$ fstring = P1+" "+P2+" "+P3+" "+P4+" "+P5
$ endif

$ if (P6 .eqs. "")
$ then
$ else
$ fstring = P1+" "+P2+" "+P3+" "+P4+" "+P5+" "+P6 
$ endif

$ if (P7 .eqs. "")
$ then
$ else
$ fstring = P1+" "+P2+" "+P3+" "+P4+" "+P5+" "+P6+" "+P7
$ endif

$ if (P8 .eqs. "")
$ then
$ else
$ fstring = P1+" "+P2+" "+P3+" "+P4+" "+P5+" "+P6+" "+P7+" "+P8 
$ endif

$ inquire/global filename "Enter Input File :"

$ Open input_file &filename

$ Open/write output_file &P0+OUT
 
$ start:

$ SP1 = ""
$ SP1 = F$locate(" ",fstring)

$ i = 0
$ ONUM = ""

$ Start1:

$ length = F$LENGTH(fstring)

$ fnew = fstring

$ read/end_of_file=endit input_file NUM

$ if i .GT. length then goto endit

$ SP2 = F$Extract(i,SP1,fnew)
$ show symbol SP2

$ !use SP2 to extract record fields from the input file.
$ ONUM = f$element(

$ i = i + SP1 + 1
$ !show symbol SP1
$ fnew = f$Extract(SP1,length,fnew)
$ goto Start1
$ endit:
$      close input_file
$      close output_file
$ exit
