count on hash file

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
bobby
Participant
Posts: 86
Joined: Mon Jul 19, 2004 8:31 pm

count on hash file

Post by bobby »

hi,
i have 2 columns in my hash file aa1 aa2, i want count of rows on cloumn aa1 in hash file
on column aa1,
i tried wc -w hashfile
it dont gave me count,
plz advice.
Thanks
Bobby
KeithM
Participant
Posts: 61
Joined: Thu Apr 22, 2004 11:34 am
Contact:

Post by KeithM »

I think your problem might that you are trying to use a Unix command in Windows.
Keith
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Dynamic hash files are binary data structures, you cannot simply do text file commands against them.

If you want to run SQL against a hash file, then search the forum for the ways to do that. If your hash file exists within a project (not fully qualified path), then use the DS Admin client and you can run SQL statements against the hash file. If the hash file is externally pathed, then you must use SETFILE to register the hash file for SQL commands first.

It's all been covered on the forum...
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
bobby
Participant
Posts: 86
Joined: Mon Jul 19, 2004 8:31 pm

Post by bobby »

hi
server is in unix
coolkhan08
Participant
Posts: 25
Joined: Wed Oct 13, 2004 1:11 am

Post by coolkhan08 »

Try this

Code: Select all

SETFILE HashFilePath HashFileName OVERWRITING

Code: Select all

Count HashFileName
U have to execute it on the command line interface in Admin else u can telnet into the server and in the uv shell execute this commands.
[/code]
bobby
Participant
Posts: 86
Joined: Mon Jul 19, 2004 8:31 pm

Post by bobby »

Hi
i am getting this error

$ SETFILE datastage01/NIN/NIN_hash updatecdatecoded OVERWRITING
ksh: SETFILE: not found
plz advice
Thanks
Bobby
dsrules
Premium Member
Premium Member
Posts: 76
Joined: Sun Nov 28, 2004 8:56 pm

Post by dsrules »

R u in uvsh? Did you the try the Admin Client on your Windows.?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use your Administrator client Command window.

The SETFILE command, if entered correctly, will work from there. It reports that a pointer has been established or that an error has occurred. If the latter you must not proceed until your SETFILE has been successful.

A hashed file is a database table, so you can use regular SQL queries on it. Beware, however, that it is case sensitive. That is, table names and column names must be entered with correct casing.

The number of rows should be the same for each column; I am not sure what you mean by "i want count of rows on cloumn aa1". You can count them with the COUNT command as shown by an earlier poster, or using SQL, for example

Code: Select all

SELECT COUNT(*) FROM updatecdatecoded;
SELECT aa1, COUNT(*) FROM updatecdatecoded GROUP BY aa1;
SELECT EVAL "If IsNull(aa1) Then 'NULL' Else aa1", COUNT(*) FROM updatecdatecoded GROUP BY aa1;
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply