Page 1 of 2

Regarding the SIze of Flat file

Posted: Tue Sep 19, 2006 11:22 pm
by boppanakrishna
hi all,
I want know the total number of records in the Sequential file ,my job design is Sequential-->Transformer-->Sequential,My exact question is to find how many rows are there in the source Sequential file..

Thanks in Advance,
Boppana Ramakrishna

Posted: Wed Sep 20, 2006 12:20 am
by Xpert
Hi BoppanaKrishna,

You can use DSGetLinkInfo function to get the count of records in source file.

Posted: Wed Sep 20, 2006 1:01 am
by ray.wurlod
Do you have MKS Toolkit or some other UNIX emulator available? If so, you can use the command wc -l filename to get the line count.

Posted: Wed Sep 20, 2006 1:38 am
by boppanakrishna
Xpert wrote:Hi BoppanaKrishna,

You can use DSGetLinkInfo function to get the count of records in source file.
hi ,
while using that DSLINKINFO it asking to pass 3 arguments ,what should i pass in that ..

Thanks in advance,
Boppana Ramakrishna

Posted: Wed Sep 20, 2006 2:18 am
by ray.wurlod
DSGetLinkInfo() requires four arguments; a handle to the job (DSJ.ME may be used), the name of the stage, the name of the link and an integer specifying what information about the link is required to be returned.

DSGetLinkInfo(hJob,Stage,Link,DSJ.LINKROWCOUNT) will return the number of rows passed along the link in the DataStage job. This is not necessarily the same as the number of lines in the source file - it might be constrained within the job or by a filter command.

Posted: Wed Sep 20, 2006 3:58 am
by Xpert
ray.wurlod wrote:DSGetLinkInfo() requires four arguments; a handle to the job (DSJ.ME may be used), the name of the stage, the name of the link and an integer specifying what information about the link is required to ...
Hi,

Syntax - DSGetLinkInfo (JobHandle, StageName, LinkName, InfoType)

As ray said, last one is not an integer, its Info type.

InfoType specifies the information required and may be one of these following:

DSJ.LINKLASTERR

DSJ.LINKNAME

DSJ.LINKROWCOUNT

DSJ.LINKSQLSTATE

DSJ.LINKDBMSCODE

DSJ.LINKDESC

DSJ.LINKSTAGE

DSJ.INSTROWCOUNT

DSJ.LINKEOTROWCOUNT

Posted: Wed Sep 20, 2006 4:16 am
by mohanraj
hi Krishna

Do you want to know the number of records in your source file without running the job or after running the job.
If it is for the former one then I don't know,but if it is the later one then you can look for the Xpert suggestion. :lol:

mohan

Posted: Wed Sep 20, 2006 4:41 am
by Xpert
mohanraj wrote:hi Krishna

Do you want to know the number of records in your source file without running the job or after running the job.
If it is for the former one then I don't know,but if it is the later one then you can look for the Xpert suggestion. :lol:

mohan
Hi mohan,

Without running the job, if you want to know the count in source file, as ray said WC -l filename command will help.

Posted: Thu Sep 21, 2006 12:27 am
by boppanakrishna
Xpert wrote:
ray.wurlod wrote:DSGetLinkInfo() requires four arguments; a handle to the job (DSJ.ME may be used), the name of the stage, the name of the link and an integer specifying what information about the link is required to ...
Hi,

Syntax - DSGetLinkInfo (JobHandle, StageName, LinkName, InfoType)

As ray said, last one is not an integer, its Info type.

InfoType specifies the information required and may be one of these following:

DSJ.LINKLASTERR

DSJ.LINKNAME

DSJ.LINKROWCOUNT

DSJ.LINKSQLSTATE

DSJ.LINKDBMSCODE

DSJ.LINKDESC

DSJ.LINKSTAGE

DSJ.INSTROWCOUNT

DSJ.LINKEOTROWCOUNT
hi xpert,
Thanks for your reply, Suppose my job name is "sample" and my stage name is "link" and my link name is " Link" and what my question is what should i pass exactly the Fourth argument so that i get the Rowcount
/* i have some but they are not working*/
Thanks In Advance,
Boppana Krishna

Posted: Thu Sep 21, 2006 12:48 am
by Xpert
boppanakrishna wrote:
Xpert wrote:
ray.wurlod wrote:DSGetLinkInfo() requires four arguments; a handle to the job (DSJ.ME may be used), the name of the stage, the name of the link and an integer specifying what information about the link is required to ...
Hi,

Syntax - DSGetLinkInfo (JobHandle, StageName, LinkName, InfoType)

As ray said, last one is not an integer, its Info type.

InfoType specifies the information required and may be one of these following:

DSJ.LINKLASTERR

DSJ.LINKNAME

DSJ.LINKROWCOUNT

DSJ.LINKSQLSTATE

DSJ.LINKDBMSCODE

DSJ.LINKDESC

DSJ.LINKSTAGE

DSJ.INSTROWCOUNT

DSJ.LINKEOTROWCOUNT
hi xpert,
Thanks for your reply, Suppose my job name is "sample" and my stage name is "link" and my link name is " Link" and what my question is what should i pass exactly the Fourth argument so that i get the Rowcount
/* i have some but they are not working*/
Thanks In Advance,
Boppana Krishna
Hi BoppanaKrishna,

DSGetLinkInfo("sample","link","Link",DSJ.LINKROWCOUNT)

By this way you have to mention for the source count.

Posted: Thu Sep 21, 2006 3:01 am
by boppanakrishna
Xpert wrote:
boppanakrishna wrote:
Xpert wrote: Hi,

Syntax - DSGetLinkInfo (JobHandle, StageName, LinkName, InfoType)

As ray said, last one is not an integer, its Info type.

InfoType specifies the information required and may be one of these following:

DSJ.LINKLASTERR

DSJ.LINKNAME

DSJ.LINKROWCOUNT

DSJ.LINKSQLSTATE

DSJ.LINKDBMSCODE

DSJ.LINKDESC

DSJ.LINKSTAGE

DSJ.INSTROWCOUNT

DSJ.LINKEOTROWCOUNT
hi xpert,
Thanks for your reply, Suppose my job name is "sample" and my stage name is "link" and my link name is " Link" and what my question is what should i pass exactly the Fourth argument so that i get the Rowcount
/* i have some but they are not working*/
Thanks In Advance,
Boppana Krishna
Hi BoppanaKrishna,

DSGetLinkInfo("sample","link","Link",DSJ.LINKROWCOUNT)

By this way you have to mention for the source count.
hi xpert ,
I have used thesame logic given by you, but i am getting the all 0's in to my target column..
My design is : sequential--> Transformer-->Sequential, in the target i have created one extra column which is not there in the source and in the derivation part i have the above logic but it is returening 0's,in the place of stage name what should i specify the outputstage or input stage and same as for the link name also..please clarify this ..

Thanks
Ramakrishna

Posted: Thu Sep 21, 2006 3:27 am
by loveojha2
DSGetLinkInfo("sample","link","Link",DSJ.LINKROWCOUNT)
Use it in after job subroutine, to make sure that whole job has run completed successfully.

Posted: Thu Sep 21, 2006 4:21 am
by mohanraj
Hi BoppanaKrishna

The Stagename you are specifying should be the active.Try it out once again with this.

Mohan

Posted: Thu Sep 21, 2006 4:41 am
by Xpert
mohanraj wrote:Hi BoppanaKrishna

The Stagename you are specifying should be the active.Try it out once again with this.

Mohan

U just change ur layout,

Sequential(Source) -----> Transformer_1 ------> Hashed File ------> Transformer_2---------> Sequential(target).

In Transformer_2 Implement those lines in the derivation part of that target column. you will get the source count. If anything feel free.......

Posted: Thu Sep 21, 2006 6:54 am
by boppanakrishna
Xpert wrote:
mohanraj wrote:Hi BoppanaKrishna

The Stagename you are specifying should be the active.Try it out once again with this.

Mohan

U just change ur layout,

Sequential(Source) -----> Transformer_1 ------> Hashed File ------> Transformer_2---------> Sequential(target).

In Transformer_2 Implement those lines in the derivation part of that target column. you will get the source count. If anything feel free.......
hi,
I have tried out your design but it is generating the same..any further suggestion is acceptable

Thanks
Boppana Ramakrishna