Saturday, 8 February 2014

Unix in Datastage



How to run a Shell Script within the scope of a Data stage job? 


By using "ExcecSH" command at Before/After job properties.

select the EDIT tab in the toolbar-> choose job properties-> select the job parameters->choose the Before/ After routines ->select the EXCESH command


How to use command line to import/export parallel job on unix

dsjob -import <projectname> <DSX filename(which is containing the executable jobs> <job/jobs names> 
Make sure you understand that the import only imports executables which usually isn't what people want. (for full export, use Manager tool)

dsimport command

The dsimport command is as follows:
dsimport.exe /D=domain /H=hostname 
/U=username /P=password 
/NUA project|/ALL|
/ASK dsx_pathname1 dsx_pathname2 ...
The arguments are as follows:
  • domain or domain:port_number. The application server name. This can also optionally have a port number.
  • hostname. The IBM® InfoSphere® DataStage® Server to which the file will be imported.
  • username. The user name to use for connecting to the application server.
  • password. The user's password .
  • NUA. Include this flag to disable usage analysis. This is recommended if you are importing a large project.
  • project, /ALL, or /ASK. Specify a project to import the components to, or specify /ALL to import to all projects or /ASK to be prompted for the project to which to import.
  • dsx_pathname. The file to import from. You can specify multiple files if required.
For example, the following command imports the components in the file jobs.dsx into the project dstage1 on the R101 server:
dsimport.exe /D=domain:9080  /U=wombat /P=w1ll1am dstage1 /H=R101 
C:/scratch/jobs.dsx
When importing jobs or parameter sets with environment variable parameters, the import adds that environment variable to the project definitions if it is not already present. The value for the project definition of the environment variable is set to an empty string. because the original default for the project is not known. If the environment variable value is set to $PROJDEF in the imported component, the import warns you that you need to set the environment variable value in the project yourself.


dsexport command

The dsexport command is as follows:
dsexport.exe /D domain /H hostname 
/U username /P password /JOB jobname 
/XML /EXT /EXEC /APPEND project pathname1
The arguments are as follows:
  • domain or domain:port_number. The application server name. This can also optionally have a port number.
  • hostname specifies the DataStage Server from which the file will be exported.
  • username is the user name to use for connecting to the Application Server.
  • password is the user’s password.
  • jobname specifies a particular job to export.
  • project. Specify the project to export the components from.
  • pathname. The file to which to export.
The command takes the following options:
  • /XML – export in XML format, only available with /JOB=jobname option.
  • /EXT – export external values, only available with /XML option.
  • /EXEC – export job executable only, only available with /JOB=jobname and when /XML is not specified.
  • /APPEND – append to existing dsx file/ only available with /EXEC option.
For example, the following command exports the project dstage2 from the R101 to the file dstage2.dsx:
dsexport.exe /D domain:9080 /H R101 /U billg /P paddock 
dstage2 C:/scratch/dstage2.dsx

No comments:

Post a Comment