On Wed, 17 Jul 2013 11:50:27 -0500, Donald Likens <[email protected]>
wrote:
>I seem to remember that there was a callable service to print data in the
>IDCAMS PRINT format.
Don't know about a service, but the following snippet of code will get you a
fair length on the way towards your goal.
Cheers,
Jantje.
#define OffsetPtr(p,o) ((void *)(((char *)(p))+(o)))
dumpShSeg(long LISEGSIZE, void *LISEGHANDLE) {
long shmoffset;
long shmoffset2;
unsigned char *c;
/* Dump the contents. */
printf("Size of shared segment is %d\n \n", LISEGSIZE);
for (shmoffset = 0; shmoffset < LISEGSIZE;
shmoffset = shmoffset
+ 16) {
printf("%.8X ", LISEGHANDLE + shmoffset);
for (shmoffset2 = shmoffset; shmoffset2 < shmoffset + 16;
shmoffset2++) {
if (shmoffset2 % 4 == 0) printf(" ");
if (shmoffset2 % 8 == 0) printf(" ");
if (shmoffset2 < LISEGSIZE) {
c = OffsetPtr(LISEGHANDLE,shmoffset2);
printf("%.2X", *c);
} else {
printf(" ");
}
}
printf(" |");
for (shmoffset2 = shmoffset; shmoffset2 < shmoffset + 16;
shmoffset2++) {
if (shmoffset2 < LISEGSIZE) {
c = OffsetPtr(LISEGHANDLE,shmoffset2);
if ((63 < *c) && (*c < 251)) {
printf("%c", *c);
} else {
printf(".");
}
} else {
printf(" ");
}
}
printf("|\n");
}
printf("\n");
fflush(stdout);
}
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN