Focal Point
how to read the specific record till the end of the file

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

February 16, 2008, 04:29 AM
mukund
how to read the specific record till the end of the file
hi,
I have to read a file and find out some specific recrord from it. If i get the record then set a flag foudn to true else set the flag to false.
this reading process has to be continued till end of file.
can u please let me know how can this be done?
using which syntax i can do it?
if it was cobol then its very easy for me but focus is quite tough, so i am asking for help
please let me know the ans ,atleast the syntax then may be i can find out rest part.


mainframe focus 7.3.5
February 16, 2008, 04:57 AM
Alan B
How are you reading the file? With TABLE from an MFD over it or using DM.

If DM, then how long is the record?

How do you determine what it is you are trying to find and how do you want the results output?


Alan.
WF 7.705/8.007
February 16, 2008, 08:19 AM
mukund
i am not sure of how to read the file.
my question was to how to code the above scenario which i have mentioned in words.

I know the coding can be easy for someone whois expert in focus but for me its very tough.
so please let me know the code even though it may be very easy for u all.


mainframe focus 7.3.5
February 16, 2008, 08:54 AM
Alan B
First off, you have to get some training.

No one here can help without some basic information and you trying at least something.


Alan.
WF 7.705/8.007
February 16, 2008, 10:09 PM
susannah
mukund, i agree w/ Alan. start by downloading *and reading* the 4 basic manuals.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
February 18, 2008, 09:19 AM
GinnyJakes
Mukund,

The suggestions on training are well noted. What you are asking to do is very basic.

However, let us assume that you want to create a report from this data. The first thing you would need is a master file description. So please look in the Describing Data manual for the data source type of your data and create a master for your data. Once you have that in place, you can do the following:

DEFINE FILE filename
SEL_FLAG/I1=IF condition true THEN 1 ELSE O;
END
TABLE FILE filename
PRINT ...
BY ...
WHERE SEL_FLAG EQ 1
etc.
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
February 18, 2008, 10:05 AM
cburtt
mukumd,

You don't tell us your end objective.
If you're setting a flag to indicate some condition of the record, then I seems quite obvious that you want want to (1) mark the records for later use/retrieval or (2) report on the records which match that condition.

GinnyJakes suggestion replaces the 'flag' in each record with a file containing records matching the desired conditions. The File is a list of records that you would have flagged.

If your intent is to permenantly mark specific records, then a simple process is to use FOCUS to duplicate the file to temp space, generating (DEFINEing) and setting the flag in each record as it is copied, deleting the original file and renaming the temporary to replace the original file (FOCUS' ability to run DOS commands is a way to do the delete/rename). Alternatively you can use IBI's MAINTAIN product to write (maintain) your flag back into appropriate records.

Still, it would be easier for us to offer solutions if we knew your total objective. Better still for everyone if you get the suggested education and/or training.

Chris Burtt


WIN/2K running WF 7.6.4
Development via DevStudio 7.6.4, MRE, TextEditor.
Data is Oracle, MS-SQL.