Skip to content

Commit 167d16a

Browse files
committed
Make column headers usable in MS Access
1 parent dd824b3 commit 167d16a

File tree

4 files changed

+26
-22
lines changed

4 files changed

+26
-22
lines changed

src/mqsmf.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ int main( int argc, char *argv[] )
125125
unsigned int totalRecords = 0;
126126
unsigned int maxRecords = 0xFFFFFFFF;
127127
unsigned int unknownCount = 0;
128+
unsigned int ignoredCount = 0;
128129
unsigned short recordSubType;
129130
unsigned short nextLength;
130131
int subTypesValid = 0;
@@ -460,7 +461,7 @@ int main( int argc, char *argv[] )
460461
/*********************************************************************/
461462
case 2:
462463
case 3:
463-
unknownCount++;
464+
ignoredCount++;
464465
break;
465466

466467
/*********************************************************************/
@@ -693,7 +694,10 @@ int main( int argc, char *argv[] )
693694

694695

695696
printf("Processed %u records total\n",totalRecords);
696-
printf(" Unknown and ignored record count: %u\n",unknownCount);
697+
if (unknownCount >0)
698+
printf(" Unknown record count: %u\n",unknownCount);
699+
if (ignoredCount >0)
700+
printf(" Ignored record count: %u\n",ignoredCount);
697701
for (i=0;i<256;i++)
698702
{
699703
if (Count115[i] > 0)

src/mqsmf.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,12 @@ extern char *strMQCHLD (int v);
248248
ADDDATA("%llu,",conv64(v))
249249

250250
#define ADDS64IDX(h,idx,v) \
251-
if (first) sprintf(tmpHead,"%s [%s]",h,idx); \
251+
if (first) sprintf(tmpHead,"%s {%s}",h,idx); \
252252
ADDHEAD(tmpHead); \
253253
ADDDATA("%lld,",conv64(v))
254254

255255
#define ADDU64IDX(h,idx,v) \
256-
if (first) sprintf(tmpHead,"%s [%s]",h,idx); \
256+
if (first) sprintf(tmpHead,"%s {%s}",h,idx); \
257257
ADDHEAD(tmpHead); \
258258
ADDDATA("%llu,",conv64(v))
259259

@@ -270,12 +270,12 @@ extern char *strMQCHLD (int v);
270270
ADDDATA("%X,",conv32(v))
271271

272272
#define ADDS32IDX(h,idx, v) \
273-
if (first) sprintf(tmpHead,"%s [%s]",h,idx); \
273+
if (first) sprintf(tmpHead,"%s {%s}",h,idx); \
274274
ADDHEAD(tmpHead); \
275275
ADDDATA("%d,",conv32(v))
276276

277277
#define ADDU32IDX(h,idx, v) \
278-
if (first) sprintf(tmpHead,"%s [%s]",h,idx); \
278+
if (first) sprintf(tmpHead,"%s {%s}",h,idx); \
279279
ADDHEAD(tmpHead); \
280280
ADDDATA("%u,",conv32(v))
281281

@@ -297,7 +297,7 @@ extern char *strMQCHLD (int v);
297297
ADDDATA("%s,",convDate(v))
298298

299299
#define ADDTIMEIDX(h,idx,v) \
300-
sprintf(tmpHead,"%s[%s] (DATE),%s[%s](TIME)",h,idx,h,idx); \
300+
sprintf(tmpHead,"%s{%s} (DATE),%s{%s}(TIME)",h,idx,h,idx); \
301301
ADDHEAD(tmpHead); \
302302
ADDDATA("%s,",convDate(v))
303303

@@ -307,7 +307,7 @@ extern char *strMQCHLD (int v);
307307
ADDDATA("%s,",convSecUSec(v))
308308

309309
#define ADDSTCKIDX(h,idx,v) \
310-
sprintf(tmpHead,"%s[%s] (S),%s[%s](US)",h,idx,h,idx); \
310+
sprintf(tmpHead,"%s{%s} (S),%s{%s}(US)",h,idx,h,idx); \
311311
ADDHEAD(tmpHead); \
312312
ADDDATA("%s,",convSecUSec(v))
313313

@@ -323,14 +323,14 @@ extern char *strMQCHLD (int v);
323323
ADDSTRN(h,v,strlen(v)) /* ASCII string null terminated*/
324324

325325
#define ADDSTRIDX(h,idx, v) \
326-
if (first) sprintf(tmpHead,"%s [%s]",h,idx); \
326+
if (first) sprintf(tmpHead,"%s {%s}",h,idx); \
327327
ADDSTRN(tmpHead,v,strlen(v))
328328

329329
#define ADDSTREN(h,v,l) \
330330
ADDSTRN(h,convStr(v,l),l) /* EBCDIC string, known length*/
331331

332332
#define ADDSTRENIDX(h,idx, v,l) \
333-
if (first) sprintf(tmpHead,"%s [%s]",h,idx); \
333+
if (first) sprintf(tmpHead,"%s {%s}",h,idx); \
334334
ADDSTREN(tmpHead,v,l) /* EBCDIC string, known length*/
335335

336336
#define COMMON_BLOCK \

src/printQTST.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ void printQTST(qtst *p)
1212
ADDU32("STOT", p->qtstzero.qtststot);
1313
ADDU32("SDUR", p->qtstzero.qtstsdur);
1414

15-
ADDU32("SHIGH[1]", p->qtstzero.qtstshig[0]);
16-
ADDU32("SHIGH[2]", p->qtstzero.qtstshig[1]);
17-
ADDU32("SHIGH[3]", p->qtstzero.qtstshig[2]);
18-
ADDU32("SLOW[1]", p->qtstzero.qtstslow[0]);
19-
ADDU32("SLOW[2]", p->qtstzero.qtstslow[1]);
20-
ADDU32("SLOW[3]", p->qtstzero.qtstslow[2]);
15+
ADDU32("SHIGH{1}", p->qtstzero.qtstshig[0]);
16+
ADDU32("SHIGH{2}", p->qtstzero.qtstshig[1]);
17+
ADDU32("SHIGH{3}", p->qtstzero.qtstshig[2]);
18+
ADDU32("SLOW{1}", p->qtstzero.qtstslow[0]);
19+
ADDU32("SLOW{2}", p->qtstzero.qtstslow[1]);
20+
ADDU32("SLOW{3}", p->qtstzero.qtstslow[2]);
2121

2222
ADDU32("SEXP", p->qtstzero.qtstsexp);
2323
ADDU32("TMSG", p->qtstzero.qtsttmsg);
2424
ADDU32("SPHW", p->qtstzero.qtstsphw);
2525

26-
ADDU32("PTOT[1]", p->qtstzero.qtstptot[0]);
27-
ADDU32("PTOT[2]", p->qtstzero.qtstptot[1]);
28-
ADDU32("PTOT[3]", p->qtstzero.qtstptot[2]);
26+
ADDU32("PTOT{1}", p->qtstzero.qtstptot[0]);
27+
ADDU32("PTOT{2}", p->qtstzero.qtstptot[1]);
28+
ADDU32("PTOT{3}", p->qtstzero.qtstptot[2]);
2929

3030
ADDU32("SHIGH", p->qtstzero.qtstphig);
3131
ADDU32("PLOW ", p->qtstzero.qtstplow);

src/smfDate.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ char * convDate(unsigned long long stcki)
7676

7777
stck = conv64(stcki); /* Always passed in z/OS endian; ensure converted */
7878

79-
if (stck == 0)
79+
if (stck == 0 )
8080
{
8181
/***********************************************************************/
8282
/* Put a hardcoded value */
@@ -93,13 +93,13 @@ char * convDate(unsigned long long stcki)
9393
t = localtime(&sec); /* Turn seconds into tm structure...*/
9494

9595
offset = strftime(stckTime,sizeof(stckTime)-1,fmt,t); /* ...and format it*/
96-
if (offset == 0)
96+
if (offset == 0 || stck < EPOCH1970)
9797
{
9898
/***********************************************************************/
9999
/* There seem to be occasions where the timestamp is not a proper */
100100
/* value - perhaps when there has been no work done for the activity */
101101
/* being recorded. So we put a hardcoded value into the string to make */
102-
/* those times easy to recognise. */
102+
/* those times (MQ bugs?) easy to recognise. */
103103
/***********************************************************************/
104104
strcpy(stckTime,epochTime);
105105
}

0 commit comments

Comments
 (0)