I'm still fairly fresh to the IBM i and have been playing around with some of the IBM APIs, specifically, QZLSCHSI - Change Server Information. This API is specifically for the iNetServer instance on the i. We've been getting errors wherein a user is disabled for iNetServer access and we need to enable them manually. Potentially, this API will allow us to do it automatically, however, I can't seem to get it to work.
Does anyone have any experience with this particular API?
I am writing the program in C, which if I recall, not many on this forum have experience with.
I've placed my code below for review. Perhaps there is something obvious that I'm missing that someone might be able to point out to me.
The code does compile, but calling the program doesn't result in enabling the specified test account.
Does anyone have any experience with this particular API?
I am writing the program in C, which if I recall, not many on this forum have experience with.
I've placed my code below for review. Perhaps there is something obvious that I'm missing that someone might be able to point out to me.
The code does compile, but calling the program doesn't result in enabling the specified test account.
Code:
#include <stdio.h> #include <string.h> #include <qusec.h> #include <qzlschsi.h> typedef struct error_code_t { Qus_EC_t ec_fields; char Exception_Data[100]; } error_code_t; main(){ error_code_t error_code; char name[10] = "RSPEIGHT"; int length = 10; char format[8] = "ZLSS0200"; char* errorCode = "X'0000'"; printf("\nBytes_Provided: %d\n", error_code.ec_fields.Bytes_Provided); \\memcpy(error_code.ec_fields.Exception_Id," ",7); \\error_code.ec_fields.Bytes_Provided = 0; printf("%s\t%d\t%s\n", name, length, format); printf("change 5 \n"); QZLSCHSI((char*)name, &length, format, (char*)&error_code ); printf("\nBytes_Provided: %d\n", error_code.ec_fields.Bytes_Provided); printf("\nException: %s\n", error_code.Exception_Data); if(error_code.ec_fields.Bytes_Provided > 0){ printf("error\n"); }; printf("Success?\n"); }
Comment