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 requirement to create a file consisting of attribute/value pairs.
My input is an Oracle table.
Currently I am using the IB sample database 'EMPDATA' as my model.
Here is what I have at the moment..
Focexec:
APP PREPENDPATH IBISAMP
FILEDEF FSEQ DISK common/fseq.txt
JOIN CLEAR *
-RUN
-*
JOIN BLANK WITH PIN IN EMPDATA TO BLANK IN FSEQ AS J1
-*
DEFINE FILE EMPDATA
BLANK/A1 WITH PIN = ' ';
ATTRIBUTE/A25 = DECODE COUNTER( 1 'LASTNAME'
2 'FIRSTNAME');
VALUE/A25 = IF COUNTER EQ 1 THEN LASTNAME ELSE FIRSTNAME;
END
-*
TABLE FILE EMPDATA
PRINT ATTRIBUTE
VALUE
IF COUNTER EQ 1 OR 2
IF LASTNAME EQ VALINO
ON TABLE SAVE AS SVATTRS
END
-RUN
-SET &WORK = &LINES;
-*
-REPEAT ENDLOOP1 &WORK TIMES
-READ SVATTRS &ATTR.A25. &VAL.A25.
-TYPE Attribute: &ATTR Value: &VAL
-ENDLOOP1
-EXIT
Results:
0 NUMBER OF RECORDS IN TABLE= 2 LINES= 2
ALPHANUMERIC RECORD NAMED SVATTRS
0 FIELDNAME ALIAS FORMAT LENGTH
ATTRIBUTE A25 25
VALUE A25 25
TOTAL 50
Attribute: LASTNAME Value: VALINO
Attribute: FIRSTNAME Value: DANIEL
The attributes are a subset of the fields in the input file. And the attribute values, are the contents of the field in the file.
I am using the McGuyver technique to do a in memory read the incoming record n number of times.
n is equal to 2 in this case, because I want two attribute/value pairs.
My request: Is there a better way to do this, then what I am doing now?
In my real case I need to create 40 attribute/value pairs (from a very wide Oracle table), and I am concerned about the growing complexity of the IF THEN ELSE structure.
Thanks in advance, DaveThis message has been edited. Last edited by: David Briars,
Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster