Question
· Jul 18, 2019

GBLOCKCOPY Batch Configuration - Where is it stored?

I need to copy a bunch of globals from some crufty old databases to spanking clean brand new ones. GBLOCKCOPY has this cool feature that lets you create a batch of global names to copy and save the list in a batch. You can then execute the batch and go take a nap.

I like naps.

I need to do this for a number of old-new database pairs, but it's the same global names every time. Is there a way to export the batch configuration created the first time and import it to another environment/namespace? These databases will be spread across multiple hosts.

Thanks!

Discussion (2)1
Log in or sign up to continue

the popular use of is INTERACTIVE.

But there is a BATCH option:   

SAMPLES>zn "%SYS"
 
%SYS>d BATCH^GBLOCKCOPY
 
1) Manage Batches
2) Run a Batch
3) Restart a Batch
4) Add Processes to a running Batch
5) Stop a Running batch
6) Monitor Running Batch
7) Batch Report
8) Exit
 
Option? 1
 
1) Create a Batch
2) Edit a Batch
3) List Batches
4) Delete a Batch
5) Exit
 
Option?

I never used it myself.

it seems to me you should find it in  ^%SYS("GBLOCKCOPY")

But the source code is open in %SYS and easy to read:

BATCH
 !
 !,"1) Manage Batches"
 !,"2) Run a Batch"
 !,"3) Restart a Batch"
 !,"4) Add Processes to a running Batch"
 !,"5) Stop a Running batch"
 !,"6) Monitor Running Batch"
 !,"7) Batch Report"
 !,"8) Exit"
 !
 Option=$$OPTION("Option? ",8,8)
 Option=1 BATCHMANAGE BATCH
 Option=2 BATCHRUN BATCH
 Option=3 BATCHRESTART BATCH
 Option=4 BATCHADDPROCESSES BATCH
 Option=5 BATCHSTOP BATCH
 Option=6 BATCHMONITOR BATCH
 Option=7 BATCHREPORT BATCH
 q
BATCHMANAGE
 !
 !,"1) Create a Batch"
 !,"2) Edit a Batch"
 !,"3) List Batches"
 !,"4) Delete a Batch"
 !,"5) Exit"
 !
 Option=$$OPTION("Option? ",5,5)
 Option=1 BATCHCREATE BATCHMANAGE
 Option=2 BATCHEDIT BATCHMANAGE
 Option=3 BATCHLIST BATCHMANAGE
 Option=4 BATCHDELETE BATCHMANAGE
 q
BATCHCREATE $zt="BATCHE"
 Name=$$GETNAME("Batch name to create? ",0,0) q:POP
 f  !!,"Adding to batch: "_Name BATCHSETUP q:POP
 BATCHCREATE
BATCHEDIT   $zt="BATCHE"
 Name=$$GETNAME("Batch name to edit? ",1,0) q:POP
 Status=$$GETSTATUS(Name,1)
 $p(Status,"~",4)'="Queue" !,"Batch "_Name_" has been run, please re-enter" BATCHEDIT
 $$YN("Do you want to add to the batch","Y")="Y" f  !!,"Adding to batch: "_Name BATCHSETUP q:POP
 $$YN("Do you want to delete entries from batch "_Name,"N")="N" BATCHEDIT
BATCHEDIT1
 SUMMARYREPORT(Name,0)
 Option=$$OPTION("Delete which entry? ",0,+$o(^|"^^"_$zu(12)|%SYS("GBLOCKCOPY",Name,""),-1))
 Option=0 BATCHEDIT
. . . . . . . .

HTH,