How about this...cut, paste, compile.

#include <stdlib.h>
#include <string.h>
#include <sys/types.h>

#include <qusec.h>
#include <qwcrsval.h>

/**************************************************************/
/* Retrieve system CCSID number */
/**************************************************************/

int retrieveSystemCCSID (void)
{
struct tableInfo
{
Qwc_Rsval_Sys_Value_Table_t ti;
int ccsid;
};

struct dataReturned
{
Qwc_Rsval_Data_Rtnd_t ri;
int Offset_Sys_Val_Table;
struct tableInfo te;
};

Qus_EC_t errCode;
struct dataReturned receiverSpc;
int sysCCSID=-1;

errCode.Bytes_Provided = sizeof(errCode);

QWCRSVAL (&receiverSpc, sizeof(receiverSpc), 1, "QCCSID ", &errCode);

if (errCode.Bytes_Available==0) {
// Quick sanity check.
if (receiverSpc.te.ti.Length_Data == sizeof(int)) {
sysCCSID= receiverSpc.te.ccsid;
}
}
return sysCCSID;
}

Need secure FTP? Forget PASE...get your FREE sFTP here
www.arpeggiosoftware.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 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.