|
Go
![]() |
New
![]() |
Search
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Member |
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 |
||
|
|
Expert |
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
|
|||||
|
|
Master |
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. |
|||
|
|
Member |
Thank you all for your responses.
It worked both ways. Your help is greatly appreciated. Alaga. |
|||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|

