Hi All, Sorry if this looks too silly, but been having tough time to figure this out.
I am passing FIELD1 from CL to RPGLE with value as 11100 (Its a 5 character field and each character has some significance - such as if library1 is found for a file, then character1 will be 1, else 0. Similarly, 5 characters for 5 libraries). So, 11100 indicates that the file is found in libraries1,2,3 and not found in libraries4,5
In RPGLE, i have to build a logic to display the libraries in which the file is found. I can manually do substring of each character and check if it is on/off, but that doesnt look good from programming perspective. So, i am holding a DS as below
D DS INZ
D LIBFND 1 5
D DIM(5)
D LIBFND1 1 1
D LIBFND2 2 2
D LIBFND3 3 3
D LIBFND4 4 4
D LIBFND5 5 5
My plan is to move the input FIELD value to LIBFND so that i can later run a for loop to check if value is set as on/off for that particular library.
So, i try to perform "MOVE FIELD1 LIBFND"
But, when i check value of LIBFND, its not 11100, rather 11111. Can you point out the mistake i am making here? How better i can handle this?
I am passing FIELD1 from CL to RPGLE with value as 11100 (Its a 5 character field and each character has some significance - such as if library1 is found for a file, then character1 will be 1, else 0. Similarly, 5 characters for 5 libraries). So, 11100 indicates that the file is found in libraries1,2,3 and not found in libraries4,5
In RPGLE, i have to build a logic to display the libraries in which the file is found. I can manually do substring of each character and check if it is on/off, but that doesnt look good from programming perspective. So, i am holding a DS as below
D DS INZ
D LIBFND 1 5
D DIM(5)
D LIBFND1 1 1
D LIBFND2 2 2
D LIBFND3 3 3
D LIBFND4 4 4
D LIBFND5 5 5
My plan is to move the input FIELD value to LIBFND so that i can later run a for loop to check if value is set as on/off for that particular library.
So, i try to perform "MOVE FIELD1 LIBFND"
But, when i check value of LIBFND, its not 11100, rather 11111. Can you point out the mistake i am making here? How better i can handle this?
Comment