Regarding the SIze of Flat 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

boppanakrishna
Participant
Posts: 106
Joined: Thu Jul 27, 2006 10:05 pm
Location: Mumbai

Regarding the SIze of Flat file

Post 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
Xpert
Premium Member
Premium Member
Posts: 85
Joined: Wed Mar 01, 2006 7:17 am

Post by Xpert »

Hi BoppanaKrishna,

You can use DSGetLinkInfo function to get the count of records in source file.
With regards,
Xpert
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
boppanakrishna
Participant
Posts: 106
Joined: Thu Jul 27, 2006 10:05 pm
Location: Mumbai

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Xpert
Premium Member
Premium Member
Posts: 85
Joined: Wed Mar 01, 2006 7:17 am

Post 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
With regards,
Xpert
mohanraj
Participant
Posts: 48
Joined: Sat Mar 25, 2006 12:40 am
Location: bangalore

Post 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
Xpert
Premium Member
Premium Member
Posts: 85
Joined: Wed Mar 01, 2006 7:17 am

Post 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.
With regards,
Xpert
boppanakrishna
Participant
Posts: 106
Joined: Thu Jul 27, 2006 10:05 pm
Location: Mumbai

Post 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
Xpert
Premium Member
Premium Member
Posts: 85
Joined: Wed Mar 01, 2006 7:17 am

Post 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.
With regards,
Xpert
boppanakrishna
Participant
Posts: 106
Joined: Thu Jul 27, 2006 10:05 pm
Location: Mumbai

Post 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
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

DSGetLinkInfo("sample","link","Link",DSJ.LINKROWCOUNT)
Use it in after job subroutine, to make sure that whole job has run completed successfully.
Success consists of getting up just one more time than you fall.
mohanraj
Participant
Posts: 48
Joined: Sat Mar 25, 2006 12:40 am
Location: bangalore

Post by mohanraj »

Hi BoppanaKrishna

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

Mohan
Xpert
Premium Member
Premium Member
Posts: 85
Joined: Wed Mar 01, 2006 7:17 am

Post 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.......
With regards,
Xpert
boppanakrishna
Participant
Posts: 106
Joined: Thu Jul 27, 2006 10:05 pm
Location: Mumbai

Post 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
Post Reply