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     [CLOSED] Dynamic Defaults in prompt

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Dynamic Defaults in prompt
 Login/Join
 
Virtuoso
posted
I want to create a dynamic default setting in my prompts fo date values.
this issue is brought up before, but I was trying this:

-* File datumcreatie.fex
FILEDEF DATUMS DISK baseapp/datumwaarden.fex
SET HOLDLIST=PRINTONLY
DEFINE FILE CAR
D1/YYMD WITH COUNTRY=DATEMOV('&YYMD','EOM');
D2/YYMD WITH COUNTRY=DATEMOV('&YYMD','BOM')-1;
D3/YYMD WITH COUNTRY=DATEMOV(D2,'BOM')-1;
END
TABLE FILE CAR
PRINT
     COUNTRY NOPRINT
HEADING
"-DEFAULT &|PRODATUM1= <D2 ;"
"-DEFAULT &|PRODATUM2= <D3 ;"
FOOTING
""
WHERE COUNTRY EQ 'ITALY';
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE SAVE AS DATUMS FORMAT WP
END


This code seems to work, but my output file is not as it should be.

this is what I get
1

  -DEFAULT &PRODATUM1= 2009/12/31 ;
  -DEFAULT &PRODATUM2= 2009/11/30 ;


Looks rather good, but the spaces in front of the dash is giving me some trouble.
Any other idea based on this would be helpfull.

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




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Virtuoso
posted Hide Post
Not necessarily simpler but would this option work perhaps?

  
-* File datumcreatie.fex
FILEDEF DATUMS DISK baseapp/datumwaarden.fex
SET HOLDLIST=PRINTONLY
DEFINE FILE CAR
D1/YYMD WITH COUNTRY=DATEMOV('&YYMD','EOM');
D2/YYMD WITH COUNTRY=DATEMOV('&YYMD','BOM')-1;
D3/YYMD WITH COUNTRY=DATEMOV(D2,'BOM')-1;
-*
-* Define as many dates as needed based on DATE_SQ
DATE_SQ/I4 WITH COUNTRY = DATE_SQ + 1;
DEF_DATE/A32 = IF DATE_SQ EQ 1 THEN '-DEFAULT &|PRODATUM1 = ' | DATECVT(D2, 'YYMD', 'A8YYMD') | ';' ELSE
               IF DATE_SQ EQ 2 THEN '-DEFAULT &|PRODATUM2 = ' | DATECVT(D3, 'YYMD', 'A8YYMD') | ';' ELSE ' ';
END
TABLE FILE CAR
PRINT
     COUNTRY NOPRINT
     DEF_DATE
WHERE RECORDLIMIT EQ 2
ON TABLE SAVE AS DATUMS FORMAT ALPHA
END


It gets around the formatting issue (the unwanted page number and leading blanks).

You may define as many dates as you need by tweaking DEF_DATE and RECORDLIMIT provided the supporting table (CAR in this case) has as many available records; otherwise McGyver can come to the rescue Smiler

- Neftali.

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



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
If it's just to find out the end of the two previous months, then you could do this just as easily in DM only:
-SET &YYM = EDIT(&YYMD,'999999');
-SET &D0  = EDIT(&YYMD,'999999') | '01';
-SET &D1  = AYM(&YYM,-1,'I6') * 100 + 1;
-SET &D2I = AYMD(&D0,-1,'I8');
-SET &D3I = AYMD(&D1,-1,'I8');
-SET &D2  = EDIT(&D2I,'9999/99/99');
-SET &D3  = EDIT(&D3I,'9999/99/99');

APP FI DATUMS DISK BASEAPP/datumwaarden.fex
-RUN
-WRITE DATUMS -DEFAULT &|PRODATUM1 = &D2
-WRITE DATUMS -DEFAULT &|PRODATUM2 = &D3

Hope this helps...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report 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     [CLOSED] Dynamic Defaults in prompt

Copyright © 1996-2020 Information Builders