Hmmm, your request is unclear to me.
Is your plan run the database extraction fro JMP or Matlab?
JMP can read an Excel file. JMP can also extract data from an Excel file using the Excel Wizard (JMP13 and higher) or using SQL. JMP has ben able to use an Excel workbook as a database since JMP 9. However, to use SQL to extract Excel and you have 64 bit JMP and 32 bit Excel, a one time special setup is needed to define the machine DSN.
That said, this line of JSL from your script
Pnames = open("$Desktop/EPI-1310-EML_V004Pnames.txt");
is opening a table and Pnames is the refernce for that table and Pnames[i] makes no sense.
Does the Pnames.txt file have a header a column header? If not, then uses this code like this
Opendt = Open( "$SAMPLE_IMPORT_DATA/EOF_comma.txt", Table Contains Column Headers( 0 ) );
If you do not have a header, and you Pnames.txt file is multiple lines, where each line is a parameter name, then to get the names use Name = :Column 1[i] .
Yo need to show what Pnames.txt and Pset.txt look like.