Parsing a file in Unix or DataStage

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
AngelMady
Participant
Posts: 16
Joined: Fri Feb 23, 2007 6:25 pm
Location: Romania

Parsing a file in Unix or DataStage

Post by AngelMady »

Hello,

I have a curiosity:

I have a script ksh which launches a job control which launches a job sequencer.

Before launching the job sequencer I want to parse a file and verify its structure. If the structure is ok then I should launch the job sequencer else nothing should happen.
Parsing of the file can be done with script ksh or the job control.
Do you know which is the best method?


Thank you in advance for your return.

Madalina
O:-)There can be only one>:)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Welcome. :D

There really is no 'best' method, do whatever works and is maintainable by the crew you have there. I would think something of this nature would be better handled in a script, depending on exactly how much of the 'structure' of the file you are attempting to verify. However, like most things DataStage, there are usually multiple ways to solve any given problem.
-craig

"You can never have too many knives" -- Logan Nine Fingers
bkumar103
Participant
Posts: 214
Joined: Wed Jul 25, 2007 2:29 am
Location: Chennai

Post by bkumar103 »

for parsing i would prefer to go for the shell script because of its performance. Using the awk command the the format can be vefied easily in the Ksh.
jdmiceli
Premium Member
Premium Member
Posts: 309
Joined: Wed Feb 22, 2006 10:03 am
Location: Urbandale, IA

Post by jdmiceli »

Perl is also quite fast for this type of activity and a little less cryptic (in my humble opinion).

Bestest!
Bestest!

John Miceli
System Specialist, MCP, MCDBA
Berkley Technology Services


"Good Morning. This is God. I will be handling all your problems today. I will not need your help. So have a great day!"
AngelMady
Participant
Posts: 16
Joined: Fri Feb 23, 2007 6:25 pm
Location: Romania

Post by AngelMady »

Hy,

In my opinion the fastest method to parse a file ( for exemple testing the length of the lines ) is to do it in a script.

I wanted to see if my opinion was right.

So, thank you all for your answers

Madalina
O:-)There can be only one>:)
turash
Premium Member
Premium Member
Posts: 51
Joined: Fri Apr 06, 2007 10:09 am
Location: Edison, NJ

Re: Parsing a file in Unix or DataStage

Post by turash »

Perl is a good option according to me anything to do with file handling or file manipulation.
AngelMady wrote:Hello,

I have a curiosity:

I have a script ksh which launches a job control which launches a job sequencer.

Before launching the job sequencer I want to parse a file and verify its structure. If the structure is ok then I should launch the job sequencer else nothing should happen.
Parsing of the file can be done with script ksh or the job control.
Do you know which is the best method?


Thank you in advance for your return.

Madalina
Post Reply