I have not used an array for years especially not in ILE.
I have a program that imports a XLSX file using POI.
In the program, I am trying to set up an array to store the column headings.
I have to validate that the users did not switch or change the column
headings.
I tried to define an array but the DIM needs qualified and the resulting use
if the array processing is not working. Guess I do not know how to.
I have googled for solutions, but all involve using the sub fields which I
do not want to do as it prevents me from doing a nice tight loop to validate
the headings. If I have to use the subfields, the code will get boringly
long and then it would be a waste of time using the array.
d dsHeader_Columns...
d ds qualified dim(58)
d Hdr_Col_A 35a inz('Row_Number')
d Hdr_Col_B 35a Inz('Zero Part Number')
d Hdr_Col_C 35a inz('Status')
d Hdr_Col_D 35a inz('AX Part No')
d Hdr_Col_E 35a inz('Vendor - Holly ADD')
d Hdr_Col_F 35a inz('lbs/ft conversion - Holly')
d Hdr_Col_G 35a inz('lbs/pc (if pc is 10.5ft)')
d Hdr_Col_H 35a inz('inches per piece')
This is the code I would like to execute.
p validate_header_row...
p b
d validate_header_row...
d pi
/free
// validate header columns in Seq
row = SSSheet_getRow(sheet: Header_row1 - 1 ); // Row 4
For Header_Column = 1 to 58;
cell = SSRow_GetCell(row: Header_Column - 1); // column A
retrieve_Cell();
If cell <> *null;
if StrVal <> %trim(dsHeader_Columns(Header_Column));
Error_Exists = 'Y';
Email_Message = %trim(email_message)
+ 'Column ' +
%Editc(dsHeader_column(Header_Column):'Z')
+ ' should = '
+ %trim(dsHeader_Columns)
+ crlf ;
ENDIF;
ENDIF;
EndFor;
// ---------------------------------------------------------
/end-free
P e
What is the best practice for this?
I am not doing any lookups in this process.
TIA
Darryl Freinkel.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.