The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script praka Shell Programming and Scripting 6 04-15-2009 07:09 AM
Need help in creating a Unix Script to parse xml file Anil.Wmg Shell Programming and Scripting 10 07-29-2008 07:58 AM
Reading file names from a file and executing the relative file from shell script anushilrai Shell Programming and Scripting 4 03-10-2006 05:25 AM
file reading in unix pradeepthanraj Shell Programming and Scripting 2 11-15-2005 09:35 AM
Reading Particular Line From A File in Unix yeheyaansari UNIX for Advanced & Expert Users 2 02-12-2002 08:42 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-25-2009
Vijay81 Vijay81 is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 1
UNIX script for reading a file and creating another file

Hi,

I am a beginner in scripting...I have to do a script where I have to read a file which has list of job names, line by line and for every line execute a dsjob command to find the log details of the job and extract only the start time of the job, if it is greater than jan 01 2008 and create an output file which has the jobname that I read followed by a comma and the start time stamp value.

If I execute the dsjob (datastage) command for a job A12TRANJB, the expected results are:

dsjob -jobinfo DDW A12TRANJB

Job Status : NOT RUNNING (99)
Job Controller : not available
Job Start Time : Tue Feb 17 22:17:10 2009
Job Wave Number : 0
User Status : not available
Job Control : not available
Interim Status : NOT RUNNING (99)
Invocation ID : not available
Last Run Time : not available
Job Process ID : 0
Invocation List : A12TRANJB

The highlighted job start time value in line 3 is the one i have to compare and if it is greater than 01/01/08, I have to write that to a file, with the job name, A12TRANJB.

I have a unix coding done for this, I know that there would be lot of mistakes..I have it here below:

HTML Code:
jobname= /apps/Ascential/Projects/jobnames
for line in $jobname
do
dsjob -jobinfo $jobname PRJ | grep `job start time` | cut -f2 -d > newfile
the highlihgted line is a datastage dsjob command which will get the job log details..

can some one please help me in this scripting?

thanks,
Vijay
  #2 (permalink)  
Old 06-29-2009
prasperl prasperl is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 22
Is it possible to get the month as numbers rather than test in your dsjob command?

Like 02 instead of Feb???
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:48 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0