Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    Get Record Count From plain/txt file
Go
New
Search
Notify
Tools
Reply
  
Get Record Count From plain/txt file
 Login/Join
 
Member
posted
Using the Execution Object: File Object to read in a text file.

Is there a way to determine how many records (rows) that the file read in has?

Use Case: If a bad validation file is created and it only contains a header, then No Email with attached document is needed. So if the file has more records other then the header record, then send the Email.

Has anyone figured out a way to do this?


iWay Service Manager (6.0.1 )
 
Posts: 8 | Registered: November 17, 2010Reply With QuoteReport This Post
Gold member
posted Hide Post
Hi,
Certainly the File Listener creates an SREG called msgsize, not sure if the file object does the same. It may be worth putting an XDQAAgent object directly after the file read, and seeing if any other SREGs appear.

Regards,
Ade.


iWay 5.5 SMSP1 and 6.0.1 on Intel/Linux
 
Posts: 59 | Location: Birmingham, Blighty | Registered: October 30, 2007Reply With QuoteReport This Post
Member
posted Hide Post
After you read the file with the file read agent, it becomes a document. Try _length(_trim(_flatOf())) and compare it to the expected header size.


iWay Service Manager (6.0.1 - patch.62627)
DMC Version 7 Release 7
 
Posts: 12 | Registered: January 24, 2011Reply With QuoteReport This Post
Member
posted Hide Post
I am going with the _length(_trim(_flatOf())) solution because low overhead of adding just a user properties and checking that value.

I appreciate both of you taking the time to provide a solution.


iWay Service Manager (6.0.1 )
 
Posts: 8 | Registered: November 17, 2010Reply With QuoteReport This Post
Member
posted Hide Post
I used _length(_trim(_flatOf())) because I found it working for the problem I had.It was a perfect solution to my problem.
 
Posts: 1 | Location: # SE 17th St Ocala, FL | Registered: September 20, 2011Reply With QuoteReport This Post
Member
posted Hide Post
Hi,

I guess you know the length of header section(consider it as 500).

COND(_LENGTH(_FLATOF()),GT,500).

Use the above in a decision check object and send the mail on the case of true or false accordingly.


iWay ISM 5.5/iWay ISM 6.0 on Windows.
 
Posts: 20 | Registered: April 11, 2011Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    Get Record Count From plain/txt file

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.