Counting Number of Lines
Posted: Thu Feb 14, 2008 10:02 pm
Hi ,
I have a requirement where I need to count number of lines in a flat file and store it in a variable ( say line_count ) .In the flat file , a trailer record will b present .In that Record , One field gives the count .If that count is equal to the line_count then the file is valid .
I can get value of line_count as follows using unix command .
line_count=`cat line_count | wc -l `
But I want it to b done in datastage . Is there any way to count number of lines in a file and store it in a variable .
From this forum , I came to know that it can b done through DSGetLinkInfo() function.
Can u plzz tell how to invoke that function ? Where to invoke that function ?
Can u plzz tell the detailed description of that as i am new to datastage .
I have a requirement where I need to count number of lines in a flat file and store it in a variable ( say line_count ) .In the flat file , a trailer record will b present .In that Record , One field gives the count .If that count is equal to the line_count then the file is valid .
I can get value of line_count as follows using unix command .
line_count=`cat line_count | wc -l `
But I want it to b done in datastage . Is there any way to count number of lines in a file and store it in a variable .
From this forum , I came to know that it can b done through DSGetLinkInfo() function.
Can u plzz tell how to invoke that function ? Where to invoke that function ?
Can u plzz tell the detailed description of that as i am new to datastage .