select controlling table scan *** adding header record create cursor ncci_header (carrier_cd c(5)......) *** get values to populate the ncci_header record Insert Into ncci_header (carrier_cd,...... ) ; values(lccarrier_cd, ..........) ** add the header record Select ncci_header Copy To ncci_header.txt Type Sdf lc_header = Filetostr('ncci_header.txt') lnbytes = Strtofile(lc_header,'policy.txt',1) *** adding location records or name records create cursor location get values to populate for location for controlling record insert into location add location to policy.txt using same routine as above endscanThere are about 7-8 more records types that in the routine that need to be added to the txt file for that one controlling record.