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.
What you need to do is order your records by the one that you wish to serialise - e.g. Father_ID -
-* The first portion of the code creates a temporary file containing your data
EX -LINES * EDAPUT MASTER,junjie,CV,FILE
FILENAME=junjie, SUFFIX=FOC
SEGNAME=SEG01, $
FIELDNAME=Father_ID, ,A9,A9,$
FIELDNAME=Child_ID, ,A9,A9,$
EDAPUT*
-RUN
CREATE FILE junjie
MODIFY FILE junjie
DATA
Father A,Child A,$
Father A,Child B,$
Father A,Child C,$
Father B,Child D,$
Father B,Child E,$
Father C,Child D,$
Father C,Child F,$
END
-RUN
TABLE FILE junjie
SUM COMPUTE CNTR/I3 = IF Father_ID EQ LAST Father_ID THEN LAST CNTR ELSE LAST CNTR + 1; NOPRINT
COMPUTE SUFF_I/I3 = IF Father_ID NE LAST Father_ID THEN 97 ELSE LAST SUFF_I + 1; NOPRINT
COMPUTE Serial_ID/A6 =LJUST(6,FPRINT(CNTR,'I3','A3')||HEXBYT(SUFF_I,'A3'),'A6');
BY Father_ID
BY Child_ID
END
-RUN
Good luck
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
Appreciate your effort. Below codes work for me perfectly.
TABLE FILE junjie SUM COMPUTE CNTR/I3 = IF Father_ID EQ LAST Father_ID THEN LAST CNTR ELSE LAST CNTR + 1; NOPRINT COMPUTE SUFF_I/I3 = IF Father_ID NE LAST Father_ID THEN 97 ELSE LAST SUFF_I + 1; NOPRINT COMPUTE Serial_ID/A6 =LJUST(6,FPRINT(CNTR,'I3','A3')||HEXBYT(SUFF_I,'A3'),'A6'); BY Father_ID BY Child_ID END -RUN
But I encountered error when I tried to run below codes to create dummy data, The error message is: Cannot include resource specified IBFS:/-LINES -* The first portion of the code creates a temporary file containing your data EX -LINES * EDAPUT MASTER,junjie,CV,FILE FILENAME=junjie, SUFFIX=FOC SEGNAME=SEG01, $ FIELDNAME=Father_ID, ,A9,A9,$ FIELDNAME=Child_ID, ,A9,A9,$ EDAPUT* -RUN
CREATE FILE junjie MODIFY FILE junjie DATA Father A,Child A,$ Father A,Child B,$ Father A,Child C,$ Father B,Child D,$ Father B,Child E,$ Father C,Child D,$ Father C,Child F,$ END -RUN
Could you help me on this as well so that I can create dummy data for test purpose in the near future.
Thank you
Jun Jie Best Regards ^^^^^^^^^^^^^^^^ Join Focal Point in June 2017 WebFOCUS 8 windows 7, HTML and PDF
Posts: 9 | Location: Singapore | Registered: May 23, 2017