[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference ilbbak::ibi_focus

Title:FOCUS, from INFORMATION BUILDERS
Moderator:ZAYIUS::BROUILLETTE
Created:Thu Feb 19 1987
Last Modified:Mon May 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:615
Total number of notes:1779

183.0. "Variable Length Records???" by STRATA::MESSIER () Tue Feb 21 1989 09:00

	Hello,
	I'm new to FOCUS and am having a problem figuring out how to
	access an external file with variable record lengths.  Does anyone
	know if this is possible?  If so can you post a sample .MAS file
	showing how this is done?  Where in the manual is this described?
	I couldn't find it anywhere.

	Any help is apprectiated,
	Rob
T.RTitleUserPersonal
Name
DateLines
183.1Anybody Out There?CIM2NI::MESSIERMon Feb 27 1989 15:449
	Does anyone ever read this conference?  After existing for two years
	it only has 183 entries.  Why is this?  Is FOCUS so good that no one
	has problems with it?  Thus no one monitors this conference? Or is
	it that nobody is using FOCUS out there?

	Anyway, if anyone can reply to .0 I appreciate it.

	Waiting patiently,
	Rob
183.2It worth a tryGVAADG::PERINOJoel PERINO @GEOTue Feb 28 1989 03:3413
	Though I never formally tried it I suppose FOCUS can handle variable
	records. I never received any messages saying "RECORD TOO LONG" or 
	something like.
	In chapter 3.5 DESCRIBING SEQUENTIAL FILES WITH SEVERAL TYPE
	OF RECORDS it is not explicitly mentioned but it let me suppose that 
	if you use SUFFIX = FIX (!) and describe your longer record it's going
	to work. Try it, it won't take you long.
	
	I don't know if someone continues to monitor this conference. I don't
	understand why there are 2 conferences FOCUS and IBI_FOCUS but I'd be
	please to know.

	Jo�l
183.3better late than neverYARD::LIHere today...Gone tomorrow...Mon Jan 28 1991 06:5782
    Hi Joel,
    
    No doubt you've solved the problem. The Focus User Manuals arn't very
    helpful are they. Anyway I had a number of problems converting a 
    RMS indexed variable record file. But I think I've succeeded(??)
    The file I converted is Indexed Sequential Hence the need for the ISAM
    suffix and the SEGMENT=ROOT.
    The GROUP clause designates the Primary key as DATE_REC, I think you
    can use the GROUP clause even if the primary key is not in sequence
    (i.e the primary key comes after some other fields)as long as the
    field sequence mirrors that of the RMS file. The size of the GROUP
    field matches that of the field/s to be used as a key, hence if your
    key is made up of other fields then ACTUAL = sizes of other fields
    added up. 
    
    The MAPFIELD clause designates that the EVENT field be used to select
    the various remaing segments to make up the whole record, in this case
    the actual is I1 which can be 0,3,5 etc But I think alphabetics can be
    used.   
    
    It's necessary to use SEGMENT=ROOT in the header segment and it's also
    neccessary to use OCCURS=1 in the Various segments, I don't know why
    but only that it works :-)
    
    Anyway I hope this helps:
    
FILE=AUDIT, SUFFIX=ISAM,$
SEGMENT=ROOT ,SEGTYPE=S0 ,$
GROUP=PRIM_KEY ,ALIAS=KEY ,USAGE=A8 ,A8 ,$
   FIELD=DATE_REC ,ALIAS= ,USAGE=A8 ,A8 ,FIELDTYPE=I ,$
  FIELD=PART     ,ALIAS=KEY1     ,USAGE=A9  ,A9  ,FIELDTYPE=I ,$
  FIELD=USERNAME ,ALIAS=         ,USAGE=A12 ,A12 ,$
  FIELD=EVENT    ,ALIAS=MAPFIELD ,USAGE=I1  ,I1  ,$
  DEFINE PRNT_DT_REC/A20=CVTSTIME(20,DATE_REC,PRNT_DT_REC);$

SEGMENT=PART_CRT ,PARENT=ROOT ,OCCURS=1 ,$
  FIELD=CREATE_PRICE ,ALIAS=  ,USAGE=D8.2,D8,$
  FIELD=MAPVALUE     ,ALIAS=0 ,USAGE=I1   ,I1 ,$
  
SEGMENT=BOM_CRT ,PARENT=ROOT ,OCCURS=1 ,$
  FIELD=BCR_CHILD    ,ALIAS=  ,USAGE=A9 ,A9 ,$
  FIELD=BCR_QUANTITY ,ALIAS=  ,USAGE=I4 ,I4 ,$
  FIELD=MAPVALUE     ,ALIAS=3 ,USAGE=I1 ,I1 ,$

SEGMENT=BOM_CHNG ,PARENT=ROOT ,OCCURS=1 ,$
  FIELD=BCH_CHILD   ,ALIAS=  ,USAGE=A9 ,A9 ,$
  FIELD=BCH_OLD_QTY ,ALIAS=  ,USAGE=I4 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