Step 6 Ignore the Column Headings

LANSA Integrator

Step 6. Ignore the Column Headings

INT004 - Using the LANSA User Agent

In this step, you will modify function iiiFN05 to ignore the column headings and map the data using the fields defined in the working list S_233RCV

1.  Edit the function iiiFN05.

     Locate the definition of the working list used to receive the data from the User Agent. The working list is called #S_233RCV and it might appear as follows:

DEF_LIST NAME(#S_233RCV) FIELDS(#EMPNO #SALARY) TYPE(*WORKING)
 

2.  Modify the definition of S_233RCV so that it matches the format of the CSV file. Your code might appear as follows:

DEF_LIST NAME(#S_233RCV) FIELDS(#EMPNO #SALARY #STARTDTER #DEPTMENT #SECTION) TYPE(*WORKING)
 

3.  Locate the commands that execute the KEYWRD subroutine to build the RECEIVE command. Change the value of the SVMODE keyword to *IGNORE. One example of why you might use *IGNORE is when the column headings are not LANSA field names. For example, the server might receive a CSV file where the column headings say 'Employee Number' instead of EMPNO.

     Your code might appear as follows:

CHANGE FIELD(#JSMXCMD) TO(RECEIVE)
EXECUTE SUBROUTINE(KEYWRD) WITH_PARMS(#JSMXCMD HANDLER ISVL)
EXECUTE SUBROUTINE(KEYWRD) WITH_PARMS(#JSMXCMD SVMODE '*IGNORE') 
USE BUILTIN(JSMX_COMMAND) WITH_ARGS(#JSMXHDLE1 #JSMXCMD) TO_GET(#JSMSTS #JSMMSG #S_233RCV)
EXECUTE SUBROUTINE(CHECK_STS)
 

4.  Compile the function.

5.  Use the User Agent to test the function as before. The result should be exactly the same.

6.  Optional. Edit your CSV file to contain column headings such as "Number, Annual  Salary, Start Date, Department, Section Code" and save your changes. If the User Agent is still open, use File / Close Source and then open your modified CSV file and send it. Once again, you should get the same results.