#! /usr/local/bin/perl %vars=""; print "What is the name of the data map you need translated?\n"; chop($in=); print "What is the name of the raw data file?\n"; chop($file=); print <); print <); open(in, "$in"); open(out, ">temp.$$"); while () { $_ =~s/- +/-/g; if (($deck eq "A") || ($deck eq "a")) { if ($_ =~/DECK = ([0-9]+)/){ $records=$1; print out " /$1\n"; } } else { if ($_ =~/'([0-9]+)'/) { print out " /$1 \n"; $records=$1; } } if (($var eq "A") || ($var eq "a")) { if ($_ =~/VAR \# ([0-9]+)/) { if (defined $vars{$1}) {} else { $_ =~s/COL +/COL/; $_ =~s/=//g; @array1=split(/COL/); $where=(split(/ +/,$array1[1]))[0]; $vars{$1} = "bob"; print out " var$1\t$where\n"; } } } if (($var eq "B") || ($var eq "b")) { if ($_ =~/REF ([0-9]+)/) { if (defined $vars{$1}) {} else { $_ =~s/COL +/COL/; $_ =~s/=//g; @array1=split(/COL/); $where=(split(/ +/,$array1[1]))[0]; $vars{$1} = "bob"; print out " var$1\t$where\n"; } } } } close (out); open(out, ">dmap.sps"); print out <) { print out $_; } close (out); print <);