Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Transforming a file inserting a new record

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Transforming a file inserting a new record
 Login/Join
 
Silver Member
posted
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,
Shrikant

This 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, 2007Report This Post
<JG>
posted
table file
print
hold
end
-run
filedef hold (apppend
-run
table file
sum
compute
onhold set holdlist
hold

everything you need is there
 
Report This Post
Virtuoso
posted Hide Post
Shrikant

I do not understand the question.
Your examples shows a 3 new lines but not on places where your question would have them.

3 client, 5 orders, so five new lines ??

Is this a reporting question or a maintain?




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Silver Member
posted Hide Post
Thanks JG and Frank for your replies.

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, 2007Report This Post
Virtuoso
posted Hide Post
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, 2007Report This Post
<JG>
posted
quote:
filedef hold (apppend

Spot the mistake

should be

filedef hold (append
 
Report This Post
Virtuoso
posted Hide Post
Shrikant,

Right! Only for the first order of each client:

  
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, 2006Report This Post
Expert
posted Hide Post
With FILEDEF, it is always good practice to use a FILEDEF ddname DISK filename after you have finished appending.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Transforming a file inserting a new record

Copyright © 1996-2020 Information Builders