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] print only fields which contain data.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] print only fields which contain data.
 Login/Join
 
Master
posted
I am trying to collapse three fields into less than that based on which fields have missing data.
My goal is to print all 3 comment fields if each one contains a comment. Otherwise, I want
to print only the fields which contain data. I am getting close, but it does not quite work.

Here is some sample RAW DATA :
quote:

ASSIGNEE WO
------------- ----
II08 0355925 C1 205M-204M 213SE09 USE CUTTER HEAVY GREASE
C2
C3 3/21/11 COMPLETE. REMOVED LIGHT DEBRIS/GREASE FROM MAI


SL7X 1578749 C1
C2
C3 MANHOLE NUMBER ___


Here is some sample OUTPUT :

quote:

XCMT1 205M-204M 213SE09 USE CUTTER HEAVY GREASE
X2
X3


XCMT1 MANHOLE NUMBER ___
X2
X3


Here is sample code:
quote:

DEFINE FILE MMDB1
NEWASG/A1 = IF (ASSIGNEE NE LAST ASSIGNEE) THEN 'Y' ELSE 'N';
XCMT1/A70 =
IF (NEWASG EQ 'Y') AND (COMMENT1 NE ' ') THEN COMMENT1
ELSE IF (NEWASG EQ 'Y') AND (COMMENT2 NE ' ') THEN COMMENT2
ELSE IF (NEWASG EQ 'Y') AND (COMMENT3 NE ' ') THEN COMMENT3
ELSE ' ';
XCMT2/A70 =
IF (NEWASG EQ 'Y') AND (COMMENT2 NE ' ') THEN COMMENT2
ELSE IF (NEWASG EQ 'N') AND (COMMENT1 NE ' ') THEN ' '
ELSE IF (NEWASG EQ 'N') AND (COMMENT1 NE ' ')
AND (COMMENT2 EQ ' ') THEN COMMENT3
ELSE ' ';
XCMT3/A70 =
IF (NEWASG EQ 'N') AND (COMMENT1 EQ ' ') THEN ' '
ELSE IF (NEWASG EQ 'N') AND (COMMENT2 EQ ' ') THEN ' '
ELSE ' ';
END

TABLE FILE MMDB
SUM
COMMENT1 AS 'C1
XCMT1
OVER
COMMENT2 AS 'C2
XCMT2 AS 'X2
OVER
COMMENT3 AS 'C3
XCMT3 AS 'X3
-*
BY ASSIGNEE
BY WO SKIP-LINE
IF RECORDLIMIT EQ 10
END
-RUN
-EXIT



Does anyone have a suggestion? Roll Eyes

Thanks!

This message has been edited. Last edited by: Tomsweb,


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Master
posted Hide Post
For something like this, you might not need any logic, just concatenate the three fields together, and use styling:

APP PREPENDPATH IBISAMP
-RUN
DEFINE FILE GGSALES
 COMMENT1/A70 = '111 1111111111 1111111111111 11111111111 111111111 ';
 COMMENT2/A70 = ' ';
 COMMENT3/A70 = '333 3333333333 3333333333333 33333333333 333333333 ';
 BIGCOMMENT/A210 = COMMENT1 | COMMENT2 | COMMENT3;
END
TABLE FILE GGSALES
PRINT UNITS
      BIGCOMMENT
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
-INCLUDE ENDEFLT.STY
  TYPE=REPORT, COLUMN=BIGCOMMENT, WRAP=3.25, $
ENDSTYLE
END
-EXIT


This 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
 
Posts: 822 | Registered: April 23, 2003Report This Post
Master
posted Hide Post
Here is what I coded to solve the problem. I coded this on the mainframe so I never considered styling.

quote:


DEFINE FILE MMDB1
XC1/A15 = 'BEERS & SCHNITZ';
XC2/A15 = 'LETS EAT BRATS!';
XC3/A15 = 'ORIOLES AWESOME';
C1OK/A1 = IF XC1 EQ ' ' THEN '0' ELSE '1';
C2OK/A1 = IF XC2 EQ ' ' THEN '0' ELSE '1';
C3OK/A1 = IF XC3 EQ ' ' THEN '0' ELSE '1';
CABC/A45 = XC1 | XC2 | XC3 ;
QCMT/A1=IF ((C1OK EQ '1') AND (C2OK EQ '1') AND (C3OK EQ '1')) THEN '1'
ELSE IF ((C1OK EQ '1') AND (C2OK EQ '1') AND (C3OK EQ '0')) THEN '2'
ELSE IF ((C1OK EQ '1') AND (C2OK EQ '0') AND (C3OK EQ '1')) THEN '3'
ELSE IF ((C1OK EQ '0') AND (C2OK EQ '1') AND (C3OK EQ '1')) THEN '4'
ELSE IF ((C1OK EQ '0') AND (C2OK EQ '0') AND (C3OK EQ '1')) THEN '5'
ELSE IF ((C1OK EQ '0') AND (C2OK EQ '1') AND (C3OK EQ '0')) THEN '6'
ELSE IF ((C1OK EQ '1') AND (C2OK EQ '0') AND (C3OK EQ '0')) THEN '7'
ELSE '9' ;
QFILE/A45 = IF QCMT EQ '1' THEN XC1 | XC2 | XC3
ELSE IF QCMT EQ '2' THEN XC1 | XC2
ELSE IF QCMT EQ '3' THEN XC1 | XC3
ELSE IF QCMT EQ '4' THEN XC2 | XC3
ELSE IF QCMT EQ '5' THEN XC3
ELSE IF QCMT EQ '6' THEN XC2
ELSE IF QCMT EQ '7' THEN XC1 ELSE ' ';
END

TABLE FILE MMDB1
PRINT
XC1
XC2
XC3
QCMT
COMPUTE QFLN/I5 = ARGLEN(45,QFILE,'I5');
COMPUTE CMT1/A15 =
IF QFLN GE 15 THEN SUBSTR(QFLN,QFILE,1 ,15,15,'A15') ELSE ' ';
COMPUTE CMT2/A15 =
IF (QCMT EQ '1' OR '2' OR '3' OR '4')
THEN SUBSTR(QFLN,QFILE,16,30,15,'A15') ELSE ' ';
COMPUTE CMT3/A15 =
IF (QCMT EQ '1') THEN SUBSTR(QFLN,QFILE,31,45,15,'A15') ELSE ' ';
-*
BY ASSIGNEE AS 'ASGN'
IF RECORDLIMIT EQ 3
END
-RUN



Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Master
posted Hide Post
quote:
Originally posted by David Briars:
For something like this, you might not need any logic, just concatenate the three fields together, and use styling:

APP PREPENDPATH IBISAMP
-RUN
DEFINE FILE GGSALES
 COMMENT1/A70 = '111 1111111111 1111111111111 11111111111 111111111 ';
 COMMENT2/A70 = ' ';
 COMMENT3/A70 = '333 3333333333 3333333333333 33333333333 333333333 ';
 BIGCOMMENT/A210 = COMMENT1 | COMMENT2 | COMMENT3;
END
TABLE FILE GGSALES
PRINT UNITS
      BIGCOMMENT
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
-INCLUDE ENDEFLT.STY
  TYPE=REPORT, COLUMN=BIGCOMMENT, WRAP=3.25, $
ENDSTYLE
END
-EXIT





Thank you Daxid.


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 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] print only fields which contain data.

Copyright © 1996-2020 Information Builders