OnDemand User Group
Support Forums => Other => Topic started by: nifipro on December 23, 2014, 04:07:42 AM
-
Hello,
I'm developing in C the CMOD userExit arsuload.DLL . I succeeded in generate the DLL and activate exist with the -E option on Arsload.exe utility.
My problem is Im unable to retrieve the LOAD_ID in my C program
Any of you can help me?
The result is either a hexa code or special characters!
The source code I use:
#include "arscsxit.h"
#include "stdio.h"
#include "locale.h"
ArcI32
ARSCSXIT_EXPORT
ARSCSXIT_API
LOADEXIT( ArsCSXitLoadExit *load )
{
ArcChar *hostname; /* OnDemand Library Server Hostname */
ArcChar *load_id; /* Load Id */
ArcU32 deprecated; /* was bytes. Use report_bytes */
ArcU32 res_bytes; /* Number of resource bytes stored */
ArcCSXitApplGroup *appl_grp; /* Application Group Info */
ArcCSXitAppl *appl; // Application Info
ArcChar *file; /* File containing all rows ===== */
ArcChar *user_def; /* User Specified string to load */
ArcCSXitField *reference; /* Reference column defined for ODF */
ArcChar *file_l; /* File containg rows in non-UTF8 */
ArcU32 cp; /* codepage file_l is in */
void **hndl; /* pointer to anchor for arsuload */
ArcChar ColDelim; /* Character used to delimit columns*/
ArcI64 report_bytes;/* Number of bytes in report */
ArcChar *instance; /* OD Instance name */
ArcChar *db_name;
printf("%p",load_id);
/* I used %s, %d option but still same error
}
-
Any Idea?????
-
> special characters!
Just guessing, but something to do with the codepage setting?
Ed
-
Is this post relevant? I believe ArcChar is an unsigned short according to arscsxit.h:
#if defined(ARS_UNICODE)
typedef unsigned short ArcChar;
#else
typedef char ArcChar;
#endif
http://stackoverflow.com/questions/8699812/what-is-the-format-specifier-for-unsigned-short-int
Essentially, try "%hu" as your printf modifier.
-
thks for your answers.
I tried with %hu parameter but still have the same problem.
LOADEXIT( ArsCSXitLoadExit *load )
{
ArcChar *hostname; /* OnDemand Library Server Hostname */
ArcChar *load_id; /* Load Id */
printf("%hu",load_id);
}
results of arload command :
C:\Program Files (x86)\ibm\OnDemand for WinNT\bin>arsload.exe -a App -g Test -u
admin -n -E -v C:\App.Test.JFF.20110118_002.10032011.1708.ard
arsload: Processing file >C:\App.Test.JFF.20110118_002.10032011.1708.ard<
arsload: 01/05/15 02:31:20 -- Indexing started, 91484 bytes to process
0425-415 CC=YES
0425-415 CCTYPE=Z
0425-415 CONVERT=NO
0425-415 CPGID=850
0425-415 MCF2REF=CPCS
0425-415 TRC=NO
0425-415 FILEFORMAT=STREAM,(NEWLINE=X'0D0A')
0425-415 TRIGGER1=*,8,X'4147454E4345203A',(TYPE=GROUP)
0425-415 TRIGGER2=6,7,X'436F646520446576697365203A',(TYPE=GROUP)
0425-415 FIELD1=0,17,4,(TRIGGER=1,BASE=0)
0425-415 FIELD2=0,22,6,(TRIGGER=2,BASE=0)
0425-415 INDEX1=X'4E6F6D',FIELD1,(TYPE=GROUP,BREAK=YES)
0425-415 INDEX2=X'5072656E6F6D',FIELD2,(TYPE=GROUP,BREAK=YES)
0425-415 DCFPAGENAMES=NO
0425-415 UNIQUEBNGS=YES
0425-415 IMAGEOUT=ASIS
0425-415 INDEXOBJ=GROUP
0425-415 INDEXSTARTBY=1
0425-415 INSERTIMM=NO
0425-415 RESTYPE=NONE
0425-415 inputdd=C:\App.Test.JFF.20110118_002.10032011.1708.ard
0425-415 outputdd=NUL
0425-415 indexdd=.\App.Test.JFF.20110118_002.10032011.1708.ard.ind
0425-415 resobjdd=NUL
0425-440 ACIF AT PK72203 HAS COMPLETED NORMALLY WITH RETURN CODE 0.
arsload: 01/05/15 02:31:21 Indexing completed
arsload: 01/05/15 02:31:21 -- Loading started, 91484 bytes to process
21268 : THIS IS THE Returned Value With the %hu parameter
OnDemand Load Id = >5016-1-0-190FAA-0-0<
Loaded 2 rows into the database
Document compression type used - OD77. Bytes Stored = >7857< Rows = >2<
arsload: 01/05/15 02:31:21 Loading completed
arsload: Processing successful for file >C:\App.Test.JFF.20110118_002.10032011.1
708.ard<
Any Idea please?
Thks
-
I guess it prints the address
Try
printf("%p",*load_id);
instead of
printf("%p",load_id);
-
Thank You Fred for your answer.
I tried it but still the same problem . Below the trace.
arsload: 01/05/15 08:32:13 -- Indexing started, 91484 bytes to process
0425-415 CC=YES
0425-415 CCTYPE=Z
0425-415 CONVERT=NO
0425-415 CPGID=850
0425-415 MCF2REF=CPCS
0425-415 TRC=NO
0425-415 FILEFORMAT=STREAM,(NEWLINE=X'0D0A')
0425-415 TRIGGER1=*,8,X'4147454E4345203A',(TYPE=GROUP)
0425-415 TRIGGER2=6,7,X'436F646520446576697365203A',(TYPE=GROUP)
0425-415 FIELD1=0,17,4,(TRIGGER=1,BASE=0)
0425-415 FIELD2=0,22,6,(TRIGGER=2,BASE=0)
0425-415 INDEX1=X'4E6F6D',FIELD1,(TYPE=GROUP,BREAK=YES)
0425-415 INDEX2=X'5072656E6F6D',FIELD2,(TYPE=GROUP,BREAK=YES)
0425-415 DCFPAGENAMES=NO
0425-415 UNIQUEBNGS=YES
0425-415 IMAGEOUT=ASIS
0425-415 INDEXOBJ=GROUP
0425-415 INDEXSTARTBY=1
0425-415 INSERTIMM=NO
0425-415 RESTYPE=NONE
0425-415 inputdd=C:\App.Test.JFF.20110118_002.10032011.1708.ard
0425-415 outputdd=NUL
0425-415 indexdd=.\App.Test.JFF.20110118_002.10032011.1708.ard.ind
0425-415 resobjdd=NUL
0425-440 ACIF AT PK72203 HAS COMPLETED NORMALLY WITH RETURN CODE 0.
arsload: 01/05/15 08:32:14 Indexing completed
arsload: 01/05/15 08:32:14 -- Loading started, 91484 bytes to process
FFFFFF83 : Returned value
OnDemand Load Id = >5016-1-0-210FAA-0-0<
Loaded 2 rows into the database
Document compression type used - OD77. Bytes Stored = >7857< Rows = >2<
arsload: 01/05/15 08:32:14 Loading completed
arsload: Processing successful for file >C:\App.Test.JFF.20110118_002.10032011.1
708.ard<
-
Try this. It worked for me.
#include <arscsxit.h>
#include <stdio.h>
ArcI32
ARSCSXIT_EXPORT
ARSCSXIT_API
LOADEXIT( ArsCSXitLoadExit *load )
{
printf("LOAD ID : %s",load->load_id);
ArcI32 rc;
rc = 0;
return( rc );
}
Output :
OnDemand Load Id = >5018-1-0-14FAA-14964-14964<
Loaded 1 rows into the database
Document compression type used - OD77. Bytes Stored = >908< Rows = >1<
LOAD ID : 5018-1-0-14FAA-14964-14964
-
Thank you for your help Frederick.
It work !!