Flogrr, thanks for the insight. I will give this a try. See what is happening is this. On the RS6000 there are files passing through with specified character length (i.e. a string that begins with AN should have 192). What is happening is that line after line works than all of a sudden null characters show up in the data. I will give your insert a try and see if the null's get trapped. Like I said earlier, awk running on AIX doesn't recognize hex. Thanks for your or anyone else's help!! I appreciate it.
This is the awk script I am running:
BEGIN {
getline rec_in_1 < "/usr/acct/acmmgr/EXTRMT.IN";
getline rec_in_2 < "/usr/acct/acmmgr/EXTRMT.IN";
getline rec_in_3 < "/usr/acct/acmmgr/EXTRMT.IN";
getline rec_in_4 < "/usr/acct/acmmgr/EXTRMT.IN";
getline rec_in_5 < "/usr/acct/acmmgr/EXTRMT.IN";
getline rec_in_6 < "/usr/acct/acmmgr/EXTRMT.IN";
getline rec_in_7 < "/usr/acct/acmmgr/EXTRMT.IN";
getline rec_in_8 < "/usr/acct/acmmgr/EXTRMT.IN";
getline rec_in_9 < "/usr/acct/acmmgr/EXTRMT.IN";
getline rec_in_10 < "/usr/acct/acmmgr/EXTRMT.IN";
rec_type_7 = substr(rec_in_7, 24, 2);
rec_type_8 = substr(rec_in_8, 24, 2);
rec_type_9 = substr(rec_in_9, 24, 2);
rec_type_10 = substr(rec_in_10, 24, 2);
rec_len7 = substr(rec_in_7, 46, 3);
rec_len8 = substr(rec_in_8, 46, 3);
rec_len9 = substr(rec_in_9, 46, 3);
rec_len10 = substr(rec_in_10, 46, 3);
close("/usr/acct/acmmgr/EXTRMT.IN"

;
}
{
sys_call = "mv " FILENAME " /rec/saleswork/saleshold/" FILENAME ".`date '+%j%H%M%S'`";
if (/[^A-Za-z0-9 \t!@#$%^&*\(\)\"\'\/.,;:]\r/) {
system(sys_call);
exit 0;
}
if (substr($0,1,2) == rec_type_7) {
if (length($0) != (rec_len7 - 1)) {
system(sys_call);
exit 0;
}
}
if (substr($0,1,2) == rec_type_8) {
if (length($0) != rec_len8 - 1) {
system(sys_call);
exit 0;
}
}
if (substr($0,1,2) == rec_type_9) {
if (length($0) != rec_len9 - 1) {
system(sys_call);
exit 0;
}
}
if (substr($0,1,2) == rec_type_10) {
if (length($0) != rec_len10 - 1) {
system(sys_call);
exit 0;
}
}
} [sig][/sig]