Focal Point
FOCUS code reference

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

February 26, 2007, 02:54 PM
rickyb
FOCUS code reference
Given the following mainframe FOCUS code:

-RSMSEL
-************************************************
DYNAM ALLOC FILE RSMLIST UNIT SYSDA SPACE 5 BLOCKS RECFM FB -
LRECL 4 BLKSIZE 200
-RUN



-************************************************
-DORSM
-************************************************
-WINDOW PW4100 EMI25 GETHOLD
-IF &EMI25 EQ ' ' THEN GOTO IFRSM;
-WRITE RSMLIST &EMI25
-GOTO DORSM



-************************************************
-IFRSM
-************************************************
-WRITE IFFILE IF RGNCODE EQ (RSMLIST)



What is the meaning of putting RSMLIST in parentheses in the last line of the code?

RGNCODE is defined as 4 character field (represents region code)
February 26, 2007, 03:05 PM
Leah
quote:
-WRITE IFFILE IF RGNCODE EQ (RSMLIST)

If I read the code correctly, it is writing IFFILE when the RGNCODE is in the file RSMLIST
a selection option.

Of course I don't do much with dialog manager, but it appears that the file is allocated, then some processing is done to create the RSMLIST data, then the processing of the IFFILE to select from what was just built. I assume &EMI25 is a parameter sent from somewhere.


Leah
February 26, 2007, 03:28 PM
Alan B
My guess is that RSMLIST is a file containing values for RGNCODE.

This follows the TABLE screening option

IF fieldname EQ (file)

and all values in the file are compared for selection.

The file RSMLIST would need to be allocated when it is to be used in this manner, as would IFFILE to be accessed and READ to get that line.


Alan.
WF 7.705/8.007
February 27, 2007, 09:12 AM
Danny-SRL
Hi Ricky,

The expression IF RGNCODE EQ (RSMLIST) is a valid IF statement. When executed FOCUS will compare the value of the field RGNCODE with the contents of the file allocated to RSMLIST. [BTW, the data within the file should be characters only - not binary - and have one value per record]

The DM statement -WRITE IFFILE IF RGNCODE EQ (RSMLIST) writes the IF statement to the file allocated to IFFILE. I suppose that somewhere along the line you will find -INCLUDE IFFILE.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

February 27, 2007, 09:13 AM
Doug at Kencura
RickyB,

Somewhere else in your code, you should see a -READ IFFILE &variable, followed by a TABLE command that has &variable within in. The code appears to be building a dynamic IF test for a later report and is saving it to a file (called IFFILE) for later use.

If this test was being used just in this code, it probably could have just been a -SET &variable = "IF RGNCODE EQ (RSMLIST);" (the IFRSM logic) or "-SET &variable = &EMI25;" (the DORSM logic).

Because it is in a file, perhaps the code is creating this file of IF tests for a later program. This is like a mailbox where one program is dropping off a letter for another program.

Like the others said, the phrase "IF field IS (holdfile)" is checking to see if the field value is one of the values in the holdfile. Keep in mind that this technique has a size limitation on the holdfile. I think it used to be limited to just 32K of data, although this may have been increased in later versions of FOCUS/WebFOCUS.


Sincerely,

Doug Lautzenheiser
Multiple products (FOCUS, WebFOCUS, iWay), releases (4-8.2), platforms (e.g., MVS, OpenVMS, Linux, iSeries, Windows), databases (e.g., Oracle, SQL Server, DB2, IMS, Hyperstage, etc.), integrated technologies (e.g., C/C++, R, Python)
Currently doing great things on WF8.2