Unable to read an ascii file in unix

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
nag0143
Premium Member
Premium Member
Posts: 159
Joined: Fri Nov 14, 2003 1:05 am

Unable to read an ascii file in unix

Post by nag0143 »

Hi-
I have converted an EBCIDIC format file into ASCII format and i am able to view the file correctly in datastage, but not able to read correctly in unix.

for eg: X field Decimal(13) value in datastage : 023467890601 and i am getting some 4bvbP for that. this is the only field i am not able to read correctly.
can some one help me to solve this.

Thanks in advance
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Packed decimal / COMP-3?
-craig

"You can never have too many knives" -- Logan Nine Fingers
nag0143
Premium Member
Premium Member
Posts: 159
Joined: Fri Nov 14, 2003 1:05 am

Post by nag0143 »

yep its COMP-3. Can u please tell me how to uncompress it in Sequential File Stage
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

OK, now I'm officially confused. You said you're already handling it correctly in DataStage but that you were "not able to read correctly in unix" which makes sense as you'll see the packed version there.

So... what exactly is the problem that you have, a UNIX or a DataStage one? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
nag0143
Premium Member
Premium Member
Posts: 159
Joined: Fri Nov 14, 2003 1:05 am

Post by nag0143 »

yes, u are right. I am not able to see in unix. Actually I need to compare this file with other based on this field. so i need this to be viewed correctly in unix.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Still confusing. This 'comparison' you need to do, is it not in a DataStage job? Why would you need to see this from the command line to do that? :?

Regardless, you won't be able to see the 'correct' value 'in UNIX' until you unpack the field and write the file out to a new location/name. And since you're already able to handle it (the COMP-3 field) correctly in DataStage, that should be simple.
-craig

"You can never have too many knives" -- Logan Nine Fingers
nag0143
Premium Member
Premium Member
Posts: 159
Joined: Fri Nov 14, 2003 1:05 am

Post by nag0143 »

I am not comparing the files in datastage, That's a huge comparision which cant be done in datastage(written a script in unix). The only thing i need is I want to see this field correctly in unix. I can see this correctly in DS, I dont know why its not happening in UNIX.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Because, as noted, DataStage is unpacking the value. You won't be able to do much in your script until you do something to unpack that field into display format - be it a DataStage job or some other tool. There's lots of utilities that can do that unpacking during the transfer from the mainframe that generated the file, convert EBCDIC to ASCII and unpack any packed fields. Or perhaps you can ask them to deliver it to you with that field unpacked.

"That's a huge comparision which cant be done in datastage"

I would beg to differ that it cannot be done. You may have already decided that you don't want to handle it there but that's a long way from can't.
-craig

"You can never have too many knives" -- Logan Nine Fingers
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Craig is right --- there are lots of ways to do comparisons in DataStage....nevertheless, convert the column into a normal character field before writing it out. When you are looking at it in DS you are probably using "View Data" which unpacks it temporarily for your viewing....you need to write it out in that unpacked format.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply