IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    ACROSS Verb Question
Go
New
Search
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Member
Posted
FOCUS MVS/390 V7.3

Hi all,
I was wondering if any of you could help me with the following case:

I have a file that looks like this:

ID CustCD CustDT CustAmt
-- ------ -------- -------
01 00001 12/31/04 12.50
01 00002 12/31/05 14.50
02 00001 12/12/05 10.00
03 00001 11/21/04 13.00
03 00001 12/22/05 12.00

I want file to look like this:

ID CustCD CustDT CustAmt CustCD CustDT CustAmt
-- ------ -------- ------- ------ -------- -------
01 00001 12/31/04 12.50 00002 12/31/05 14.50
02 00001 12/12/05 10.00 0 0 0.00
03 00001 11/21/04 13.00 00001 12/22/05 12.00

Your help is greatly appreciated.

Thanks,

Alaga
 
Posts: 6 | Registered: June 04, 2007Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
Alaga, you're going to want to define a variable that enumerates the number of records per ID.
There are several ways to do this, the least elegant of which might be:
DEFINE FILE ..
FLAG/I4=IF ID NE LAST ID THEN 1 ELSE 1 + LAST ID;
END
TABLE FILE ...
SUM CustCD CustDT CustAMT
BY ID
ACROSS FLAG AS ''
END




DevStu 767; wintell 767; Unix 765,Oracle: /// iplanet; Dev 765 tomcat 6;///MRE/BID/PMF
 
Posts: 2624 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteEdit or Delete MessageReport This Post
Master
Posted Hide Post
I think this could be done a little more simply:
-*maybe NODATA if required
SET NODATA=0
TABLE FILE fileName
SUM CustCD CustDT CustAMT
BY ID
ACROSS CUST_CD NOPRINT
END


(There is no such concept as 'least elegant' Susannah, just different approaches.)


Alan.
WF 7.6.5, PMF 5.1, MRE,RA,RG, etc... Win2003(8xQuad)/IIS/Tomcat with SSL and AD security.
 
Posts: 848 | Location: Portugal | Registered: February 07, 2007Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Thank you all for your responses.

It worked both ways.

Your help is greatly appreciated.

Alaga.
 
Posts: 6 | Registered: June 04, 2007Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    ACROSS Verb Question

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