Page 1 of 1

delete all data sets in a folder using orchadmin in Windows

Posted: Wed Apr 10, 2019 10:05 pm
by Developer9
Hi,

Currently I am deleting individual data sets using batch(bat) file using below code.It works well ..

Code: Select all

@ECHO OFF
C:\IBM\InformationServer\Server\PXEngine\bin\orchadmin rm datasetfolder\dataset1.ds
C:\IBM\InformationServer\Server\PXEngine\bin\orchadmin rm datasetfolder\dataset2.ds
Similarly ,I would like to delete all datasets in the folder ..I tried using wild card "*.ds" instead of filename it did not work.I tried several options with rm but none of them worked.

Code: Select all

WARNING: could not delete datasetfolder\*.ds because it does not exist.

Please let me know what changes needed in the bat file

Thanks

Posted: Thu Apr 11, 2019 1:45 am
by chulett
That command doesn't support wildcards. If you want to do some flavor of "all" I would assume you would need to loop through a list of names and call the command in an iterative fashion. Fairly straight forward with a UNIX script... DOS batch file? No clue.

Posted: Thu Apr 11, 2019 9:27 pm
by UCDI
this works on ours as a routine -- *.* style wildcards work just fine...
I don't know how much it needs to change for windows. Could be an OS problem though.. maybe unix allows *.ds and windows did not?




deffun GetEnvVariable(Arg1) calling "DSU.GetEnvVariable"
Ans=""
PlatForm='UNIX'
AptConfigValue=GetEnvVariable('APT_CONFIG_FILE')
FullFileName=FilePath : '/' : DatasetFileName
myTmpDir=GetEnvVariable('TMPDIR')
appOrchDir=GetEnvVariable('APT_ORCHHOME')
MyCommand='export TMPDIR=':myTmpDir:'; export APT_CONFIG_FILE=':AptConfigValue:' ; ':appOrchDir:'/bin/orchadmin rm ':FullFileName
Call DSExecute(PlatForm,MyCommand,DSExecuteOutput,DSExecuteResultCode)
Call DSLogInfo(DSExecuteOutput,'OrchadminDeleteDataSet')
Ans = DSExecuteResultCode