As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I have a file containing client no, order no and order line no. This has to be transformed to a new file such that for each client no a new line has to be inserted for the first order.
Input
Client No Order No Order Line no
12345 A001 0001
12345 A001 0002
12345 A001 0003
12345 A003 0001
12345 A003 0002
23456 A002 0001
23456 A002 0002
34567 A005 0001
34567 A006 0001
Desired Output:
Client No Order No Order Line no
12345 A001 0001
12345 A001 0002
12345 A001 0003
12345 A001 9999
12345 A003 0001
12345 A003 0002
23456 A002 0001
23456 A002 0002
23456 A002 9999
34567 A005 0001
34567 A005 9999
34567 A006 0001
Can anyone help me out in adding a new record one for the first order of each client.
Thanks, ShrikantThis message has been edited. Last edited by: Kerry,
FOCUS 7.2.3 Platform: IBM system Z9 Business class O/P formats: Flat files, excel and CSV files
Posts: 39 | Location: Hyderabad, India | Registered: April 28, 2007
Frank - As mentioned, I need to have a extra line only for the first order of any client. That means the number of new lines inserted should be equal to distint clients in the input file and it has to be inserted for the first order of that client.
FOCUS 7.2.3 Platform: IBM system Z9 Business class O/P formats: Flat files, excel and CSV files
Posts: 39 | Location: Hyderabad, India | Registered: April 28, 2007
Do it as JG already indicated in his post. You have everything in place. So first table the input file entirely, printing all fields you need. Then table the file again, only now do a sum and a by for clientnr and a by lowest 1 for your ordernumber and compute the new orderline number. BE sure the result is exactly the same as the first table and append it to the first table. Then table the resulting file in the order you need. You only need to translate these hints into real code.
Hope this helps....
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
TABLE FILE SHRIKANT
PRINT CLIENTNO ORDERNO LINENO
ON TABLE HOLD AS ADDREC FORMAT ALPHA
END
FILEDEF ADDREC DISK ADDREC.FTM (APPEND
SET HOLDLIST=PRINTONLY
TABLE FILE SHRIKANT
SUM FST.ORDERNO
COMPUTE NEWLINE/I4L=9999;
BY CLIENTNO
ON TABLE SAVE AS ADDREC
END
TABLE FILE ADDREC
PRINT LINENO
BY CLIENTNO
BY ORDERNO
END
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006