We have moved to www.dataGenX.net, Keep Learning with us.
Showing posts with label Script. Show all posts
Showing posts with label Script. Show all posts

Saturday, June 27, 2015

Unlocking XMETA locks from jobs

How can I unlock an XMETA locked job?

The job cannot be exported and when attempting to open the job, the following error appears:

Unable to open the Job
The Job 'TestJob' is locked by user 'dsadm'
(SessionID '8F1B0326-4F7E-45A8-B8EC-EAA8C4780528')

Do you want to continue and open a read-only view of the Job?
This issue arises when a lock still remains in XMETA for the corresponding job. Information Server will lock the job to ensure that there is no indeterminancy regarding the editing and saving of a job.
The most common causes of this is when a user has closed a client window unexpectedly (e.g. Force Terminate).

Thursday, April 23, 2015

Script to UnLock DataStage Jobs


This script will help you to unlock the all jobs, if you are a DS admin, or your datastage jobs , if a DS developer, without doing human error while executing command on Datastage server UV shell or Datastage Administrator Client.

Script is quite simple, Execute it , it will ask for Project Name and Job Name and Done if you have appropriate access on Datastage server.

May be need a modification as per your Datastage platform or if you need some fancy stuff to add on.  Happy Scripting !!


Tuesday, April 07, 2015

Get Datastage Job Lock List by Script


** This script will fetch all locks currently on Datastage Server irrespective of Projects.
** We can modify this script to correct the data display format as per our need
** Can modify sort command as it changes its behavior in different Linux flavour


Monday, April 06, 2015

DataStageBackup Dos Script


Guys, sorry for being away for so many days but I am back :-)

Today, I am going to share a batch script , written by KIM DUKE, hats off to him :-). Originally this script is designed for Datastage 7.5 but we can easily re-write for current versions. Please play with it and share your script if possible :-)

Tuesday, July 15, 2014

Handling Filename with Spaces in Linux


Spaces in Unix/Linux Filename is not a good habit as usually it is used as delimiter for field values rather than being in filename itself. In Linux, SPACE is used as a IFS ( Internal Field Separator) that is used for word splitting after expansion and to split lines into words with the read build in command. The default values of IFS is SPACE, TAB, NEW LINE.

     This is why whenever we are doing something with File-name having spaces in Linux, we got error like..
: No such File or Directory

   What if you got some files from a "Unix dumb" Server source, How you will handle the filename with spaces, Here are some simple ways to deal with it.


Tuesday, June 10, 2014

Interview Questions : Unix/Linux : Part-8

1. Display all the files in current directory sorted by size?
ls -l | grep '^-' | awk '{print $5,$9}' |sort -n|awk '{print $2}'


2. Write a command to search for the file 'map' in the current directory?
find -name map -type f

3. How to display the first 10 characters from each line of a file?
cut -c -10 filename

4. Write a command to remove the first number on all lines that start with "@"?
sed '\,^@, s/[0-9][0-9]*//' < filename

Thursday, March 27, 2014

Get list of locked item on DataStage Server with Script


This script can be run with or without any argument and provide the list of Job, item locked in DataStage environment by any user. This script will help release the locks if user doesn't locked the item.

Script Name : DSgetJobLocks.sh
Usage : ./DSgetJobLocks.sh [one or more argument]


Thursday, March 13, 2014

DOS Batch Script to Export DataStage Jobs Automatically from a Project



Copy the following script into a text file and rename into ".bat" file.

 This batch script is used to Export all jobs from a Projects
 This script must be run from a DataStage client machine and the parameters below should be given


 Host is server name
 User is DataStage username
 Password is DataStage password
 Imp Location is the directory where the datastage dsx's are stored



Friday, February 28, 2014

Check whether DataStage Job is Multi-Instance or not with Sctipt


The following script can be used to check if the given datastage job is multi instance or not.

Arguments to the Scripts:

Arg1:Datastage Project Name
Arg2:JobName


Wednesday, February 26, 2014

Get DataStage Job Information without using Director


With the help of this script, You can get the job no, category and other information without opening DataStage Director.

This Script need two arguments :
1. DataStage Project Name
2. DataStage Job Name

Script :

Friday, June 14, 2013

Execute an SQL script file in SQLPlus - Oracle




To execute a script file in SQLPlus, type @ and then the file name.
SQL > @{file}

For example, if your file was called script.sql, you'd type the following command at the SQL prompt:
SQL > @script.sql

The above command assumes that the file is in the current directory. ( the current directory is usually the directory that you were located in before you launched SQLPlus.)

Wednesday, April 24, 2013

Wednesday, April 03, 2013

DataStage client receives error when compile jobs: Cannot get exclusive access to executable file for job sampleJob - job may be being monitored


Problem :


DataStage user sees the following error in Designer client when attempting to compile a specific job:
Cannot get exclusive access to executable file for job sampleJob - job may be being monitored.

Similar problems may occur in other releases.


Monday, March 18, 2013

Interview Questions : Unix/Linux : Part-7


For more : visit here

1. How to display the processes that were run by your user name ?
ps -aef | grep <user_name>

2. Write a command to display all the files recursively with path under current directory?
find . -depth -print

Friday, March 08, 2013

Count User logins in Nix


This script will count the User logins on the Server and if you pass the username to script, It will fetch the last login details of the user.


Tuesday, March 05, 2013

Linux script to collect system statistics and send to your email


This script can use to daily send the system statistics server. It will also reformat the output to replace tabs with 5 spaces so it will display nicely on your email client.

Tuesday, February 26, 2013

Interview Questions : Unix/Linux : Part-6




1.       How do you write the contents of 3 files into a single file?
cat file1 file2 file3 > file

2.       How to display the fields in a text file in reverse order?
awk 'BEGIN {ORS=""} { for(i=NF;i>0;i--) print $i," "; print "\n"}' filename

3.       Write a command to find the sum of bytes (size of file) of all files in a directory.
ls -l | grep '^-'| awk 'BEGIN {sum=0} {sum = sum + $5} END {print sum}'

Monday, February 25, 2013

FTP auto-login Script



FTP auto-login.  "ftp" to a site and have the password stored.

For instance, here's a sample ".net" file in a user's home directory for uploading to sourceforge. Note, sourceforge will take any password, so m@temp.com is used here for login "anonymous".


Monday, December 24, 2012

The Unix "SCRIPT" command : a command recorder




script is a standard Unix command that records a script of your interaction with the Unix system. Once it's started, it works "in the background", meaning that you continue to work normally, but the script session is dumping everything that shows up on your screen (more or less*) into some file. It probably would be better called carbon-copy. 

The most common use of script  is to document terminal session. By running script you log all the information displayed on your terminal. You can then print the log file or view it with an editor. In a way script is a specialized tee for the shell.

Tuesday, November 27, 2012

Saving Shell Script with executable permissions: tips & tricks



In our tech routine we daily usually need to write small script to do task easily. Sometimes its irritating to edit/create and save and give the executable permissions.

What if when we create a file it have the executable permissions, Yes, we can do that with the help of umask but this will applicable on all files so don’t want that. So here is the solution….