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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     FOCUS code reference

Read-Only Read-Only Topic
Go
Search
Notify
Tools
FOCUS code reference
 Login/Join
 
Member
posted
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)
 
Posts: 10 | Registered: May 11, 2005Report This Post
Virtuoso
posted Hide Post
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
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Virtuoso
posted Hide Post
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
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
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

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Member
posted Hide Post
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
 
Posts: 7 | Location: Midwest United States | Registered: February 14, 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     FOCUS code reference

Copyright © 1996-2020 Information Builders