The previous method was very stupid. It was to concatenate each field into a string using the | method.
In fact, only now can we find that we can use runsqlstmt to run this SQL statement and then output it to a spool file.
The following is the idea:
1. Assemble the SQL statement, the old oneProgramAvailable
2. output the assembled SQL statement to the default member of qtemp/runsqlsrc.
3. Call runsqlstmt to execute the SQL statement.
4. Copy the output spool file to PF.
5. Copy to folder or Sendmail if you like to download
So it will be easy to translate to excel.
However, it is only an idea, and there is no time to build it.
Advantages:
1. Supports dynamic SQL
2. A general query can be made based on dynamic SQL, and a search range can be input to the customer.
3. You can save the query results to PF for customers to download.
4. Multiple SQL statements can be separated by semicolons.