diff --git a/CHANGES.md b/CHANGES.md index 2059fef..0540072 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -77,3 +77,6 @@ May 2018 (v4.1.0) Jun 2018 (v4.2.0) * Visual Studio 2017 compiler warnings fixed * -f sql was not setting correct internal flags + +Jul 2018 (v4.3.0) +* Add command for converting VBS dataset to USS on z/OS diff --git a/bin/aix/convH b/bin/aix/convH index 80a127a..24f0441 100755 Binary files a/bin/aix/convH and b/bin/aix/convH differ diff --git a/bin/aix/mqsmfcsv b/bin/aix/mqsmfcsv index 6a3e946..151fb25 100755 Binary files a/bin/aix/mqsmfcsv and b/bin/aix/mqsmfcsv differ diff --git a/bin/linux/convH b/bin/linux/convH index 401b5d7..a4c0f58 100755 Binary files a/bin/linux/convH and b/bin/linux/convH differ diff --git a/bin/linux/mqsmfcsv b/bin/linux/mqsmfcsv index 94f6f12..3062913 100755 Binary files a/bin/linux/mqsmfcsv and b/bin/linux/mqsmfcsv differ diff --git a/bin/win/mqsmfcsv.exe b/bin/win/mqsmfcsv.exe index e7efd29..1e0f62f 100755 Binary files a/bin/win/mqsmfcsv.exe and b/bin/win/mqsmfcsv.exe differ diff --git a/mqsmfcsv.doc b/mqsmfcsv.doc index 89ab77a..1e9b617 100755 Binary files a/mqsmfcsv.doc and b/mqsmfcsv.doc differ diff --git a/src/cpvbuss b/src/cpvbuss new file mode 100755 index 0000000..12c5398 Binary files /dev/null and b/src/cpvbuss differ diff --git a/src/cpvbuss.c b/src/cpvbuss.c new file mode 100755 index 0000000..70db0e5 --- /dev/null +++ b/src/cpvbuss.c @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2016,2018 IBM Corporation and other Contributors. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Douglas Burns + */ + +/***************************************************************************/ +/* This program is to be run on z/OS if the file transfer mechanism to get */ +/* the SMF data to the workstation platform does not support VBS datasets. */ +/* */ +/* For example sftp works from USS files and the SMF dataset needs to be */ +/* converted before sftp can process the z/OS file. */ +/***************************************************************************/ +#include +#include + +#define BUFFERLENGTH 10485760 /* Max length of record accepted */ + +/**********************************************************************/ +/* Function name: main */ +/* */ +/* Description: Reads the specified dataset and writes the */ +/* contents */ +/* */ +/* Receives: Two parameters - SMF VBS dataset to read */ +/* USS file to write */ +/* */ +/* */ +/**********************************************************************/ +int main(int argc, char *argv[] ) +{ + char inputDatasetName[4096]; + char escapedInputDatasetName[4096]; + char outputFileName[4096]; + + FILE *inputFile; + FILE *outputFile; + + char databuffer[BUFFERLENGTH]; + + int dataLength = 0; + int recordCount = 0; + + /* */ + /* Handle the arguments passed */ + /* */ + if (argc < 3) { /* need prog name + two parm */ + printf("\n%s called with incorrect arguments\n",argv[0] ); + printf(" expected parms are DATASETNAME FILENAME\n "); + printf(" where\n"); + printf(" DATASETNAME = name of input dataset\n"); + printf(" FILENAME = name of output file\n"); + return(4); + } + strcpy(inputDatasetName, argv[1]); + strcpy(outputFileName, argv[2]); + + strcpy(escapedInputDatasetName, "//'"); + strcat(escapedInputDatasetName, inputDatasetName); + strcat(escapedInputDatasetName, "'"); + + /* Open input file */ + if ((inputFile = fopen(escapedInputDatasetName, "rb, type=record, recfm=*")) == NULL) { + printf("Could not open dataset: %S\n", inputDatasetName); + return(4); + } + + /* Open output file */ + if ((outputFile = fopen(outputFileName, "wb")) == NULL) { + printf("Could not open file: %S\n", outputFileName); + return(4); + } + + /* Read in the data */ + while (dataLength = fread(&databuffer, 1, BUFFERLENGTH, inputFile)) { + recordCount++; + + /* Write the data */ + fwrite(&databuffer, 1, dataLength, outputFile); + } + + /* Close files */ + fclose(inputFile); + fclose(outputFile); + + printf("\n *** %d records written. ***\n", recordCount); + + printf("\n"); +} diff --git a/src/smfDDL.c b/src/smfDDL.c index 288f38c..ff8e0db 100755 --- a/src/smfDDL.c +++ b/src/smfDDL.c @@ -111,7 +111,7 @@ void closeDDL(char *name) { char *c = indexSet[i]; if (c) { - fprintf(fp,"CREATE INDEX %s_%s ON %s.%s(%s);\n",name,c,schema,name,c); + fprintf(fp,"CREATE INDEX %s.%s_%s ON %s.%s(%s);\n",schema,name,c,schema,name,c); } } fprintf(fp,"\n");