Hello again,
Thank you for the feedback. Out of an abundance of curiosity, I tried both of Dieter ‘s suggestions. First, I tried changing the .IMPORT to VARTEXT as recommended; I must confess I was not aware of the VARTEXT option. This worked, but only returned the database definition and other queried data for the first name in the list from dbnames.txt. The script then ended, without repeating the process for the other 235 databases on the TPDID.
I then re-edited the BTEQ script to try using the DATA mode importing, and changing to CHAR(30) for export, as shown below:
.logon <TPDID>/<myusername>,<mypassword>;
.export DATA file=c:\bteq\dbnames.txt;
SELECT DatabaseName (TITLE '') FROM "DBC".Databases;
.export reset;
.export report file=c:\bteq\dbdefs.txt;
.import DATA file=c:\bteq\dbnames.txt;
Using (DatabaseName char(30))
EXECUTE DBADMIN.ShowDatabase (:DatabaseName);
.Repeat *;
.export reset;
.quit;
This also worked, but as with the VARTEXT edit, the script only returned the desired results for the first named database in the dbnames.txt file. The script then ended, without repeating the process as above.
At this point, it appears that the .REPEAT * statement is not looping the execution of the macro through all of the listed names in dbnames.txt. Is the placement of the .REPEAT statement incorrect, ie should I move it before the EXECUTE? If so, that is counter to my understanding of how .REPEAT works. Or am I missing an additional statement that will allow the macro to execute for each name in the dbnames.txt list (as mentioned previously, there are over 230 db names in that list)? Thanks!
Mike
Hello again,
Thank you for the feedback. Out of an abundance of curiosity, I tried both of Dieter ‘s suggestions. First, I tried changing the .IMPORT to VARTEXT as recommended; I must confess I was not aware of the VARTEXT option. This worked, but only returned the database definition and other queried data for the first name in the list from dbnames.txt. The script then ended, without repeating the process for the other 235 databases on the TPDID.
I then re-edited the BTEQ script to try using the DATA mode importing, and changing to CHAR(30) for export, as shown below:
.logon <TPDID>/<myusername>,<mypassword>;
.export DATA file=c:\bteq\dbnames.txt;
SELECT DatabaseName (TITLE '') FROM "DBC".Databases;
.export reset;
.export report file=c:\bteq\dbdefs.txt;
.import DATA file=c:\bteq\dbnames.txt;
Using (DatabaseName char(30))
EXECUTE DBADMIN.ShowDatabase (:DatabaseName);
.Repeat *;
.export reset;
.quit;
This also worked, but as with the VARTEXT edit, the script only returned the desired results for the first named database in the dbnames.txt file. The script then ended, without repeating the process as above.
At this point, it appears that the .REPEAT * statement is not looping the execution of the macro through all of the listed names in dbnames.txt. Is the placement of the .REPEAT statement incorrect, ie should I move it before the EXECUTE? If so, that is counter to my understanding of how .REPEAT works. Or am I missing an additional statement that will allow the macro to execute for each name in the dbnames.txt list (as mentioned previously, there are over 230 db names in that list)? Thanks!
Mike