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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Focus
 Login/Join
 
Silver Member
posted
In a input file i have 2 fields as such
roll no. status
01 y
01
01 N
02 N
02 N
03
03
03
04 Y
04 Y
04 N

Now in the output file i need to print roll no and status only once for each roll no and the status should be 'Y' if any one of the particular roll no. has 'Y' else it should print 'N'
Ex - The ouput should be
roll no. status
01 Y
02 N
03 N
04 Y
as roll no. 1 has atleast one status as 'Y" so its output status should be 'Y'
roll no 2 has no status as 'Y' so its output status should be 'N'
Similarly as roll no. 3 has no status as 'Y' so its output should be 'N'
and as roll no. 4 has atleast one status as 'Y' so its output status should be 'Y'

So can u sugest some solution


FOCUS 7.1.1/ MF(OS/390)
 
Posts: 40 | Location: Chennai, India | Registered: January 31, 2007Report This Post
Expert
posted Hide Post
It's hard to focus when the topic title is "Focus".

Why not use a more descriptive title?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
You file has to be pre-sorted by Roll No.

Then you can code something like this:

FILEDEF TEMP2 DISK C:\IBI\APPS\TEMP\TEMP2.FTM

DEFINE FILE TEMP2
FINAL_STATUS/A1 = 
IF STATUS EQ 'Y' THEN 'Y' ELSE
IF ROLL_NO EQ LAST ROLL_NO AND STATUS IN (' ','N') AND FINAL_STATUS NE 'Y' THEN 'N' ELSE 
IF ROLL_NO NE LAST ROLL_NO AND STATUS IN (' ','N') THEN 'N' ELSE FINAL_STATUS ; 
END
 
TABLE FILE TEMP2
SUM
FINAL_STATUS
BY ROLL_NO
END


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
Wasn't this question posted in an earlier thread?

focus

manash, posting the same question multiple times isn't going to get you more answers, it's just going to frustrate those that are trying to help.

-- Dan

P.S. You need a subject more descriptive than "Focus", too. Like "Focus condensing output".

Dan Kenny
University of Nebraska at Omaha
Prod: WF 7.1.6 Linux -- Test: WF 7.6.0 Linux
 
Posts: 63 | Registered: March 07, 2006Report This Post
Expert
posted Hide Post
Hi manash,

Can you please try the following code:

FILEDEF MYFILE DISK C:\IBI\APPS\DIALOGUE_MANAGER\MYFILE.TXT
-RUN
TABLE FILE MYFILE
PRINT 
STATUS
COMPUTE
NEWSTAT1/I1=IF LAST ROLLNUM NE ROLLNUM THEN 1 ELSE 0;
GOODSTAT/A1=IF NEWSTAT1 EQ 1 AND STATUS EQ 'Y' THEN 'Y' ELSE 'N';
WHERE TOTAL NEWSTAT1 EQ 1
BY ROLLNUM
END


The data:
myfile.txt
01 Y
01
01 N
02 N
02 N
03
03
03
04 Y
04 Y
04 N

Hope this helps.

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
Platinum Member
posted Hide Post
xx/a1 =
if ((rollno eq last rollno) and (last status
eq 'y') then 'y' else
if ((rollno eq last rollno) and (status
eq 'y')) then 'y' else
if (rollno eq last rollno) then 'n';

you can make this more nested, but i elongated to make it more legible. Hope it helps...


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
 
Posts: 195 | Registered: October 27, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders