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
Condition Checking
 Login/Join
 
<Umar Farook S>
posted
Hi
I need to checking for 2 conditions on same field in select part of the code.
1st cond::
CASE TRADE_SEQ_NR
WHEN 1 THEN 'OPEN CONTRACTS' ELSE 'CLOSED CONTRACTS' END AS CONTRACT_STATUS,
2nd cond::
when trade seq number is not equal to one then a field called trade_date should be between &startdate and &end date

how am i supposed to do that

::One more problem::
in subhead i need to display only the end date for open trades but both start_date and end_date for closed_trades

pls also guide me on both of the above issues.
 
Report This Post
Virtuoso
posted Hide Post
Are you wanting to control something else besides subheads or subfoots?
 TABLE FILE CAR
SUM SEATS
BY COUNTRY
BY CAR
ON COUNTRY SUBFOOT
"  This is WHERE <COUNTRY"
WHEN COUNTRY EQ 'FRANCE' OR 'ENGLAND'
ON COUNTRY SUBFOOT
"This is WHEN <COUNTRY"
WHEN COUNTRY NE 'FRANCE' OR 'ENGLAND'
END 


Have to play with the date though.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Virtuoso
posted Hide Post
 DEFINE FILE CAR
DATEA/MDYY WITH CAR = IF COUNTRY EQ 'ENGLAND' OR 'FRANCE' THEN 0 ELSE '&MDYY';
DATEB/MDYY WITH CAR = '&MDYY';
END
TABLE FILE CAR
SUM SEATS
BY COUNTRY
BY CAR
ON COUNTRY SUBFOOT
"  This is WHERE <COUNTRY WHEN <DATEB <DATEA"
WHEN COUNTRY EQ 'FRANCE' OR 'ENGLAND'
ON COUNTRY SUBFOOT
"This is WHEN <COUNTRY <DATEB TO <DATEA"
WHEN COUNTRY NE 'FRANCE' OR 'ENGLAND'
END  


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
<Umar Farook S>
posted
Thanks very much Leah
Actually i was trying to implement the same for SUBHEAD and it worked at its best.

The date problem i am having is like i need to restrict datas in select statement itself.
:::CODE::::
CASE TRADE_SEQ_NR
WHEN 1 THEN 'OPEN CONTRACTS' ELSE 'CLOSED CONTRACTS' END AS CONTRACT_STATUS
CASE
WHEN TRADE_SEQ_NR <> '1' THEN TRADE_DATE BETWEEN TO_DATE('&STARTDATE','MM/DD/YYYY') AND TO_DATE('&ENDDATE','MM/DD/YYYY')
END AS CLOSED_DATE
FROM MurexODS.TRADE

When the contract status is 'closed contracts' or trade seq no is Not Equal 1 i need to get only datas for trade date which is in between the start and end date entered by the user.

the code above throws me error.
 
Report This Post
Virtuoso
posted Hide Post
A where statement can be made very complex if you want, so a quick stab, since you are putting this in non focus text here would be a where

WHERE ( ( TRADE_SEQ_NR EQ '1' ) OR
( ( TRADE_SEQ_NR NE '1' ) AND
( ( TRADE_DATE GE '&STARTDATE') AND
( TRADE_DATE LE '&ENDDATE' ) ) ) );

Hopefully my parenthesis balance.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
<Umar Farook S>
posted
Thanks Leah
It worked fine.
 
Report This Post
Virtuoso
posted Hide Post
You're most welcome Umar.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
<Umar Farook S>
posted
Hi Leah

Can you help or guide me with reading data from an external file into webfocus.
 
Report This Post
Virtuoso
posted Hide Post
quote:
Can you help or guide me with reading data from an external file into webfocus.


Probably should have opened a new topic, but when you say reading an external file, what do you want to do with it? My experience is mostly using filedef for decodes, or using table commands against flat files that have a mfd defined in conjunction with the filedef. Don't use the -read though so not familiar enough to tell you.

You will definitly need a filedef defining the file if it is not defined in your data source.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
<Umar Farook S>
posted
Actually i need to read 2 external files compare them based on key fields then display the non-matched rows as a report output.
 
Report This Post
Virtuoso
posted Hide Post
Do you have master file discriptions for the files? If you did, you could use the standard match file logic.

match file a
print (whatever you want to pring)
by key field (or multiple by)
run
file b
print (whatever you want to pring)
by key field (or multiple by)
after match hold as hold old-not-new
end
table file hold
print.....
end

If you don't have MFD's you will have to do more work defining key fields for both and use -read which have no experience with.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
<Umar Farook S>
posted
Thanks Leah will get back to you after doing some research.

Can you suggest me where i can some details regarding this problem.
 
Report This Post
Virtuoso
posted Hide Post
quote:
Can you suggest me where i can some details regarding this problem.


I'd suggest doing a technival documentation search. Do you have manuals to reference. There are PDF versions you can download.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
<Umar Farook S>
posted
Please let me know where i can do the search and from where i can download the PDF's.
 
Report This Post
Virtuoso
posted Hide Post
quote:
Please let me know where i can do the search and from where i can download the PDF's.


If you look in the top right corner of the 'screen' when you are on the forum there is a link. You might want to explore the site as well. Good luck.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
<Umar Farook S>
posted
Hi Leah,

I am just trying to read a CSV file in Webfocus

::MASTER FILE::

FILE=TESTCSV, SUFFIX=COM
SEGNAME=ROOT_SEG, SEGTYPE=S1, $
FIELD=Num, ALIAS=FIELD1, USAGE=A20, ACTUAL=A20, $
FIELD=Name, ALIAS=FIELD2, USAGE=A20, ACTUAL=A50, $
FIELD=Age, ALIAS=FIELD3, USAGE=A20, ACTUAL=A50, $
FIELD=Gender, ALIAS=FIELD4, USAGE=A20, ACTUAL=A50, $

::CSV FILE::
2,VINI,33,M

::FEX CODE::

FILEDEF TESTCSV DISK \\imnt14\SHARED\TRANSFER\Test3.csv

TABLE FILE TESTCSV
PRINT
Num
Name
Age
Gender
ON TABLE HOLD AS NEW
END
-RUN
-*
TABLE FILE NEW
PRINT *
END
-EXIT

But i could not find what is the error in this code.Its always returning 0 errors 0 lines.
its unable to read the csv file.I like to know for webfocus to read this file where it ahs to be placed.Is there any specific folder or directory where we have to place the csv file so that webfocus can read it from that particular location.Or even when placed in desktop it should read the file.
Please advice.
 
Report This Post
Virtuoso
posted Hide Post
Is the path you have defined for the test2.csv in a location that the WebFOCUS server knows?


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
<Umar Farook S>
posted
Thats the doubt i am having Leah.
Please let me know where i can find it or where the file has to be placed generally.
 
Report This Post
Virtuoso
posted Hide Post
quote:
Please let me know where i can find it or where the file has to be placed generally.


In this case, you'll need to talk to whomever administers the WebFOCUS installation.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
<Umar Farook S>
posted
Thanks Leah
Will get back to you soon
 
Report This Post
<Umar Farook S>
posted
Hi Leah,

I have coded to read 2 csv files.Contents of the csv files are same but file names are different.
Now i need to compare both the files and print it.
I tried using MATCH FILE syntax but its not getting printed.Pls advice.
I ma posting my fex code here for your reference.

::code::
-* File qmtarde1csv.fex

FILEDEF QMTRADE1 DISK \\IMNT14\SHARED\TRANSFER\NEW_TRADE1.CSV
FILEDEF QMTRADE2 DISK \\IMNT14\SHARED\TRANSFER\NEW_TRADE2.CSV

TABLE FILE QMTRADE1
PRINT
TradeDate
Portfolio
NotionalAmt
TradeCounterParty
AssetSubType
AssetType
BY MMRefNumber
ON TABLE HOLD AS QMTRADEONE
END
-RUN
-*
-*TABLE FILE QMTRADEONE
-*COUNT *
-*END
-*-EXIT

DEFINE FILE QMTRADE2
END
-*
TABLE FILE QMTRADE2
PRINT
TradeDate
Portfolio
NotionalAmt
TradeCounterParty
AssetSubType
AssetType
BY MMRefNumber
ON TABLE HOLD AS QMTRADETWO
END
-RUN
-*
MATCH FILE QMTRADEONE
MORE
FILE QMTRADETWO
RUN
AFTER MATCH HOLD OLDANDNEW
END
-*
TABLE FILE HOLD
PRINT *
END
-EXIT

::error::
--------------------------------------------------------------------------------

No HTML Output!

--------------------------------------------------------------------------------


0 NUMBER OF RECORDS IN TABLE= 3808 LINES= 3808

0 NUMBER OF RECORDS IN TABLE= 3808 LINES= 3808

(FOC009) INCOMPLETE REQUEST STATEMENT
BYPASSING TO END OF COMMAND
0 NUMBER OF RECORDS IN TABLE= 0 LINES= 0
 
Report This Post
<Umar Farook S>
posted
I changed my MATCH FILE as

MATCH FILE QMTRADEONE
BY MMRefNumber
MORE
FILE QMTRADETWO
BY MMRefNumber
AFTER MATCH HOLD OLDANDNEW
END
-RUN
-*
TABLE FILE HOLD
PRINT *
END
-EXIT

But still I am getting output as
--------------------------------------------------------------------------------

No HTML Output!

--------------------------------------------------------------------------------


EDA no/data
 
Report This Post
Expert
posted Hide Post
Umar,

With the amount of support that Leah has graciously given you, you now ought to think about paying her!!!

T
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
<Umar Farook S>
posted
Thankz Tony
 
Report This Post
Expert
posted Hide Post
Umar,

It looks like you are confusing MATCH with Universal Concatenation (MORE) and you have a syntax error on final match command.

Try this:

MATCH FILE QMTRADE1
PRINT
TradeDate
Portfolio
NotionalAmt
TradeCounterParty
AssetSubType
AssetType
BY MMRefNumber
RUN
FILE QMTRADE2
PRINT
TradeDate
Portfolio
NotionalAmt
TradeCounterParty
AssetSubType
AssetType
BY MMRefNumber
AFTER MATCH HOLD OLD-AND-NEW
END
-*
TABLE FILE HOLD
PRINT *
END


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
<Umar Farook S>
posted
Hi Ginny
Thanks very much it worked fine.i made those changes already.But got very much cleared now.
In the same code i need to match all the columns for both the hold files.
How can i do that.So that any difference of value even in one field should be identified.
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders