delete all data sets in a folder using orchadmin in Windows

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Developer9
Premium Member
Premium Member
Posts: 187
Joined: Thu Apr 14, 2011 5:10 pm

delete all data sets in a folder using orchadmin in Windows

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
UCDI
Premium Member
Premium Member
Posts: 383
Joined: Mon Mar 21, 2016 2:00 pm

Post 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
Post Reply