DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
Developer9



Group memberships:
Premium Members, Heartland Usergroup

Joined: 14 Apr 2011
Posts: 182

Points: 2610

Post Posted: Wed Apr 10, 2019 10:05 pm Reply with quote    Back to top    

DataStage® Release: 11x
Job Type: Parallel
OS: Windows
Hi,

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

@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:
WARNING: could not delete datasetfolder\*.ds because it does not exist.



Please let me know what changes needed in the bat file

Thanks
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 42923
Location: Denver, CO
Points: 221366

Post Posted: Thu Apr 11, 2019 1:45 am Reply with quote    Back to top    

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

The Old Ones were, the Old Ones are, and the Old Ones shall be. Not in the spaces we know, but between them. They walk serene and primal, undimensioned and to us unseen.
Rate this response:  
Not yet rated
UCDI



Group memberships:
Premium Members

Joined: 21 Mar 2016
Posts: 355

Points: 3699

Post Posted: Thu Apr 11, 2019 9:27 pm Reply with quote    Back to top    

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
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours