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

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

552.0. "FAB bit SUBMIT_ON_CLOSE" by PARITY::ORNSTEIN (Ian Ornstein DTN 247-2492) Fri Sep 11 1987 18:41

    I have a need to create a file with FAB bit
    
    		SUBMIT_ON_CLOSE set to true.
    
    The things that I have tried so far that DIDN'T WORK are:
    
    Create/fdl    and
    Convert/fdl
    
    Perhaps one of the hackers could show me hou to use PATCH
    to turn on the bit (I need help finding it too!).
    
    						Thanks,
    						- Ian -
T.RTitleUserPersonal
Name
DateLines
552.1CHOVAX::YOUNGBack from the Shadows Again,Sat Sep 12 1987 00:517
    As I recall, the SUBMIT_ON_CLOSE is not a file creation option,
    it is only a file access option.  Which is to say you cannot 'Set'
    a file SUBMIT_ON_CLOSE, oyu can only set an access stream to be
    SUBMIT_ON_CLOSE.
    
    
    --  Barry
552.2Use USEROPEN or TLE's FOR$FAB, PAS$FAB functions.CASEE::VANDENHEUVELHein, Valbonne.Mon Sep 14 1987 09:4175
    CREATE/FDL and CONVERT/FDL take FDL clauses and turn them into
    fixed file attributes. You can specify the so called runtime
    attributes using FDL but only through calling FDL$CREATE and
    they will only be valid for the duration of that open.
    Any subsequent open will take it's runtime characteristices 
    from the FAB or the environment.
    In general it makes no sense specifiying runtime characteristics
    in an FDL. You need to set up your FAB for that. How exactly to
    set up your FAB depends on the Language that you are using, but
    most languages EXCEPT COBOL have a USEROPEN.  For COBOL, which
    I believe is the language you are using, you need a bit a hack.
    I almost the right thing for you, but before you use it I strongly
    suggest you consider it's maintenance impact and check out the
    alternatives like:
    		-  Calling SYS$SNDJBC to submit a job
    		-  Rolling your own FAB & RAB and calling SYS$OPEN...
    
    Here's the hack:
    
	The original reason i made that hack was to set some
	special rms option on connect time. What you would
	have to change is a way to make the RAB address available
	externally. To do this I would declare a global variable
	in the macro source and move the RAB address into it on
	connect time. In the cobol program you declare the same
	variable as external. Then IMMEDIATLY after the OPEN of
	any file you can move the rab address into a local variable
	reserved for that file. You can now call a subroutine
	passing that RAB-address-variable BY VALUE and furhter info.
	In the routine you define a RAB layout in the linkage section.
	Then set up a keybuffer (or perhaps you can simply use the
	key in the record itself?), flag the REGARDSLESS and call
	SYS$FIND passing the rab structure by ref.
    	
    	From the RAB you can follow a pointer to find the FAB
    
$! CONNECT.MAR, Hein van den Heuvel
$! Create user written connect routine
$CREATE CONNECT.MAR

	$RABDEF					;Define RAB Bit's & Bytes
;
; The linker will not resolve internal references to transfer vectors!
; See bottom of page 4-8 in the Linker Reference Manual.
;
	.TRANSFER	SYS$CONNECT		;Entry for user program
	.ENTRY		SYS_CONNECT, ^M<>	;Local entry point
	MOVL		4(AP), R0		;MAGIC: get RAB address
;
; Here we could verify that this is the correct RAB by following the back
; pointer to the FAB and then examining the file name. Or by looking into
; a global variable... We won't however. 
; Ready to do to the RAB whatever needs to be done now! For example:
;
	BISL2	#RAB$M_UIF, RAB$L_ROP(R0)	;Set Update_IF ROP bit in RAB
;
; We could also move the FAB and/or RAB address to a global variable, to be
; picked up and acted upon by the main line code...
; All pointers set? Call in the real SYS$CONNECT.
;
	CALLG   (AP), G^SYS$CONNECT		;Call real SYS$CONNECT
	RET					;Back to normal
	.END
$
$MACRO CONNECT.MAR
$LINK/SHARE=SYS$LOGIN:CONNECT.EXE CONNECT
$ASSIGN SYS$LOGIN:CONNECT.EXE CONNECT
$!COPY CONNECT.EXE SYS$LIBRARY:
$!LINK application,SYS$INPUT/OPT
$!CONNECT/SHARE
$!and so on.

    	Hope this helps,    
                        Hein.