Focal Point
[CLOSED] Adding a new value in the -PROMPT

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/849101583

March 03, 2010, 07:48 AM
Poryes
[CLOSED] Adding a new value in the -PROMPT
Hello all-

This is my first post in this forum.

My requirements is to add a value 'ALL' in the state field.

Existing code:

-PROMPT &&JATE.ENTER 4 DIGIT JOURNAL DATE(0100).
-PROMPT &&TDATE.ENTER 6 DIGIT TRANSMIT DATE(990409).
-PROMPT &&DST.ENTER 2 DIGIT STATE (OH CA FL).

As per the new requirement, I need to add the code as below

-PROMPT &&DST.ENTER 3 DIGIT STATE (OH CA ALL).

When the end user selects ST equals to ALL then need to make a
match on JDATE, TDATE

When the end user NOT selects ST equals to ALL the need to make a
match on JDATE, TDATE, ST

I have not been able to figure out exactly can do that? was hoping someone could
supply me with some specifics about the code that would be required to accomplish this task.

Best Regards,
Poryes

Focus Mainframe 7.3.6

This message has been edited. Last edited by: Kerry,
March 03, 2010, 10:15 AM
GinnyJakes
-SET &ST_WHERE=IF &&DST EQ 'ALL' THEN ' ' ELSE 'put your where clause here with appropriate tick marks';
TABLE FILE filename
...
&ST_WHERE.EVAL
WHERE &&JDATE EQ ...
WHERE &&TDATE EQ ...
...
END

Also you can search the forum for EVAL to get other examples.


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
March 03, 2010, 10:50 AM
Glenda
I apply the same technique as Ginny but instead of using empty quote marks when I don't want a where statement, I use '-*'.

 
-SET &HSSCO    = DECODE &ROUND(1 '-*'
-                              2 'WHERE CO EQ ''101'''
-                              3 'WHERE CO EQ ''104'''
-                              4 'WHERE CO EQ ''106'''
-                              5 'WHERE CO EQ ''104'''
-                              6 'WHERE CO EQ ''106''');

TABLE FILE FILENAME
PRINT FLD1
      FLD2
&HSSCO.EVAL
END
-EXIT


Works everytime!


Glenda

In FOCUS Since 1990
Production 8.2 Windows
March 03, 2010, 12:48 PM
njsden
You can also make use of my all-time favourite FOC_NONE:

-SET &DST_FILTER = IF &&DST EQ 'ALL' THEN FOC_NONE ELSE &&DST;
TABLE FILE filename
...
WHERE JOURNAL_DATE EQ &&JDATE
WHERE TRANSMIT_DATE EQ &&TDATE
WHERE DIGIT_STATE EQ &DST_FILTER
...
END


Hope that helps,
- Neftali.



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.
March 03, 2010, 02:58 PM
GinnyJakes
He's using mainframe FOCUS and I don't know if FOC_NONE is available there which is why I didn't recommend it in the first place. I was lazy and didn't feel like looking it up. Do you know if it is?


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
March 03, 2010, 03:13 PM
Francis Mariani
Is not mentioned in any of the Mainframe Version 7 Release 3 documentation.


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
March 03, 2010, 03:53 PM
njsden
Quite honestly I am not sure. I keep forgetting that there is another world besides WebFOCUS out there. I hope I didn't end up confusing things. Frowner

- Neftali.



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.
March 03, 2010, 03:55 PM
njsden
Well, based on this: http://www.informationbuilders...5-1/01b_painter.html it seems like the feature is available in FOCUS:

quote:
FOCUS has a new feature that is the secret to making the ALL option work. A special keyword FOC_NONE has been added to the FOCUS language that if returned to the reporting engine will bybass the parameter and return all values for that field


I hope it indeed relates to Mainframe FOCUS since the article seems to make references to WebFOCUS and FOCUS somewhat interchangeably.

- Neftali.



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.
March 03, 2010, 04:05 PM
Dan Satchell
If FOC_NONE won't work, you could try this (using Neftali's example):

-SET &DST_FILTER = IF &&DST EQ 'ALL' THEN '$*' ELSE &&DST;

TABLE FILE filename
...
WHERE JOURNAL_DATE EQ &&JDATE
WHERE TRANSMIT_DATE EQ &&TDATE
WHERE DIGIT_STATE EQ '&DST_FILTER'
...
END



WebFOCUS 7.7.05
March 04, 2010, 06:12 AM
Poryes
Thanks a lot Ginny/Glenda/Neftali/Dan.

I believe, I'm not specific with my qestion.

If end user selects ST equals to 'ALL' then make a MATCH on JDATE and TDATE to modify the table.
In other words all ST values that satisfy the match.

When the end user NOT selects ST equals to ALL the need to make a match on JDATE, TDATE, ST to modify the table.
please guide how to accomplish this task.

Thanks in advance...

Best Regards,
Poryes

Focus Mainframe 7.6.5
March 04, 2010, 07:25 AM
Dan Satchell
I am assuming from your explanation that columns JDATE, TDATE, and ST are all keys. If you want to MODIFY the data in the table, then the easiest method is to produce a HOLD file containing the desired key values and use the HOLD file as input to the MODIFY. Otherwise, if ST is a key and you do not provide the ST values, then you must use NEXT (and probably CASE) logic, which becomes considerably more complicated.

-PROMPT &JDATE.ENTER 4 DIGIT JOURNAL DATE(0100). 
-PROMPT &TDATE.ENTER 6 DIGIT TRANSMIT DATE(990409).
-PROMPT &DST.ENTER 3 DIGIT STATE (OH CA FL ALL).
-*
TABLE FILE filename
 BY JDATE
 BY TDATE
 BY ST
 WHERE JDATE EQ &JDATE
 WHERE TDATE EQ &TDATE
-IF &DST EQ 'ALL' GOTO SKIP_ST ;
 WHERE ST EQ '&DST'
-SKIP_ST
 ON TABLE HOLD
END
-*
MODIFY FILE filename
 FIXFORM FROM HOLD
 MATCH JDATE TDATE ST
   ON MATCH ...
   ON NOMATCH ...
 DATA ON HOLD
END

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
March 17, 2010, 08:42 AM
Poryes
Sorry for my late response Dan.

I have modified the code and ran the focexec, Got the below error.

(FOC538) SU. CENTRAL AND LOCAL USERS HAVE DIFFERENT MASTER DESCRIPTIONS:
TRANSACTIONS: TOTAL = 0 ACCEPTED= 0 REJECTED= 0
SEGMENTS: INPUT = 0 UPDATED = 0 DELETED = 0

Regards,
Poryes

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


WebFOCUS 7.6.13

Mainframe
all output (Report in mainframe)