$! ................... Cut between dotted lines and save. ................... $!........................................................................... $! VAX/VMS archive file created by VMS_SHARE V06.10 7-FEB-1989. $! $! VMS_SHARE was written by James Gray (Gray:OSBUSouth@Xerox.COM) from $! VMS_SHAR by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au). $! $! To unpack, simply save, concatinate all parts into one file and $! execute (@) that file. $! $! This archive was created by user DOMILLER $! on 7-DEC-1989 09:03:54.78. $! $! It contains the following 1 file: $! GEN_COBOL_DEFS.COM $! $!============================================================================ $ SET SYMBOL/SCOPE=( NOLOCAL, NOGLOBAL ) $ VERSION = F$GETSYI( "VERSION" ) $ IF VERSION .GES "V4.4" THEN GOTO VERSION_OK $ WRITE SYS$OUTPUT "You are running VMS ''VERSION'; ", - "VMS_SHARE V06.10 7-FEB-1989 requires VMS V4.4 or higher." $ EXIT 44 ! SS$_ABORT $VERSION_OK: $ GOTO START $! $UNPACK_FILE: $ WRITE SYS$OUTPUT "Creating ''FILE_IS'" $ DEFINE/USER_MODE SYS$OUTPUT NL: $ EDIT/TPU/COMMAND=SYS$INPUT/NODISPLAY/OUTPUT='FILE_IS'/NOSECTION - VMS_SHARE_DUMMY.DUMMY b_part := CREATE_BUFFER( "{Part}", GET_INFO( COMMAND_LINE, "file_name" ) ) ; s_file_spec := GET_INFO( COMMAND_LINE, "output_file" ); SET( OUTPUT_FILE , b_part, s_file_spec ); b_errors := CREATE_BUFFER( "{Errors}" ); i_errors := 0; pat_beg_1 := ANCHOR & "-+-+-+ Beginning"; pat_beg_2 := LINE_BEGIN & "+-+-+-+ Beginning"; pat_end := ANCHOR & "+-+-+-+-+ End"; POSITION ( BEGINNING_OF( b_part ) ); LOOP EXITIF SEARCH( SPAN( ' ' )@r_trail & LINE_END, FORWARD) = 0; POSITION( r_trail ); ERASE( r_trail ); ENDLOOP ; POSITION( BEGINNING_OF( b_part ) ); i_append_line := 0; LOOP EXITIF MARK ( NONE ) = END_OF( b_part ); s_x := ERASE_CHARACTER( 1 ) ; IF s_x = '+' THEN r_skip := SEARCH( pat_beg_1, FORWARD, EXACT ); IF r_skip <> 0 THEN s_x := ''; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ERASE_LINE; ENDIF ; ENDIF; IF s_x = '-' THEN r_skip := SEARCH( pat_end, FORWARD, EXACT ) ; IF r_skip <> 0 THEN s_x := ''; MOVE_HORIZONTAL( -CURRENT_OFFSET ); m_skip := MARK( NONE ); r_skip := SEARCH( pat_beg_2, FORWARD, EXACT ); IF r_skip <> 0 THEN POSITION( END_OF( r_skip ) ); MOVE_HORIZONTAL( -CURRENT_OFFSET ) ; MOVE_VERTICAL( 1 ); MOVE_HORIZONTAL( -1 ); ELSE POSITION( END_OF( b_part ) ); ENDIF; ERASE( CREATE_RANGE( m_skip, MARK( NONE ), NONE ) ); ENDIF; ENDIF ; IF s_x = 'V' THEN s_x := ''; IF i_append_line <> 0 THEN APPEND_LINE ; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ENDIF; i_append_line := 1 ; MOVE_VERTICAL( 1 ); ENDIF; IF s_x = 'X' THEN s_x := ''; IF i_append_line <> 0 THEN APPEND_LINE; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ENDIF ; i_append_line := 0; MOVE_VERTICAL( 1 ); ENDIF; IF s_x <> '' THEN i_errors := i_errors + 1; s_text := CURRENT_LINE; POSITION( b_errors ); COPY_TEXT ( "The following line could not be unpacked properly:" ); SPLIT_LINE ; COPY_TEXT( s_x ); COPY_TEXT( s_text ); POSITION( b_part ); MOVE_VERTICAL ( 1 ); ENDIF; ENDLOOP; POSITION( BEGINNING_OF( b_part ) ); LOOP r_x := SEARCH ( "`", FORWARD, EXACT ); EXITIF r_x = 0; POSITION( r_x ); ERASE_CHARACTER( 1 ); COPY_TEXT( ASCII( INT( ERASE_CHARACTER( 3 ) ) ) ); ENDLOOP ; IF i_errors = 0 THEN SET( NO_WRITE, b_errors, ON ); ELSE POSITION ( BEGINNING_OF( b_errors ) ); COPY_TEXT( FAO ( "The following !UL errors were detected while unpacking !AS", i_errors , s_file_spec ) ); SPLIT_LINE; SET( OUTPUT_FILE, b_errors, "SYS$COMMAND" ) ; ENDIF; EXIT; $ DELETE VMS_SHARE_DUMMY.DUMMY;* $ CHECKSUM 'FILE_IS $ WRITE SYS$OUTPUT " CHECKSUM ", - F$ELEMENT( CHECKSUM_IS .EQ. CHECKSUM$CHECKSUM, ",", "failed!!,passed." ) $ RETURN $! $START: $ FILE_IS = "GEN_COBOL_DEFS.COM" $ CHECKSUM_IS = 106899607 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X$! X$! Drive generation of COBOL definition file from MACRO definitions X$! X$! Usage: X$!`009`009@COBOL_DEFS`009name X$! X$! where $NAME is a definitional macro in either STARLET.MLB or LIB.MLB. X$! Output: []'p1'.H X$! V$! Note: This command file can be changed to produce files in languages othe Xr V$! than COBOL. To do this, change the definitions of "lang" and "type" to th Xe V$! language name and default file type for include files; the "write DEFS_MAR X" X$! statements to create header and trailer comments appropriate to the new X$! language; and the definition of the macro EMIT to produce the right kind X$! of definition lines. X$! X$! Originally written and posted to INFOVAX by: X$! V$! W.J.Moeller, GWDG, D-3400 Goettingen, F.R.Germany X$! Phone +49 551 201516 X$! X$! Later revised by Jerry Leichter (LEICHTER@YALE) X$! X$! Revision History X$! 0.0`009??-???-?? WJM`009Creation V$! 1.0`009 6-Apr-87 JSL`009Centralize actual creation of output lines in the X EMIT X$!`009`009`009macro; this makes changes a lot easier. Similarly, X$!`009`009`009define the output file type ("type") and the language X$!`009`009`009("lang") in symbols to simplify changes. Allow for X$!`009`009`009special handling of negative values in EMIT - for C, X$!`009`009`009wrap them in parentheses. Try to warn the user if X$!`009`009`009it looks like there was an error. X$ set noon X$ on control_y then goto fin X$ lang = "COBOL" X$ type = "COB" X$ open/write DEFS_MAR []defs.tmp X$ write DEFS_MAR " .print;*" X$ write DEFS_MAR " .print;*`009`009`009`009''p1'.''type'" X$ write DEFS_MAR " .print;*" X$ write DEFS_MAR " .print;* Definitions created by ''lang'_DEFS",`009- X`009`009`009`009`009" at ''f$time()'" X$ write DEFS_MAR " .print;*" X$ write DEFS_MAR " $''p1'" X$ write DEFS_MAR " .print;*" X$ write DEFS_MAR " .print;* End of ''lang'_DEFS definitions" X$ write DEFS_MAR " .print;*" X$ write DEFS_MAR " .end" X$ close DEFS_MAR X$! X$ define/user SYS$ERROR 'p1'.'type`009! MACRO puts .PRINT output here X$ macro/nolist/noobject SYS$INPUT+SYS$LIBRARY:LIB/LIB+SYS$DISK:[]defs.tmp X .MACRO $GBLINI GBL X`009.MACRO`009EMIT`009SYM,VVALUE X.print;01 SYM PIC 9(8) COMP-1 VALUE VVALUE . X;.print;01 SYM PIC 9(8) COMP-1 VALUE EXTERNAL SYM . X`009.ENDM X .MACRO $DEF SYM,ALLOC,SIZ X .if NB,SYM XSYM: X`009EMIT`009SYM,\SYM X .endc X .IIF NB,ALLOC, ALLOC SIZ X .ENDM $DEF X .MACRO $EQU SYM,VAL X SYM=VAL X`009EMIT`009SYM,\SYM X .ENDM $EQU X .MACRO $VIELD1 MOD,SEP,SYM,SIZ,MSK X SIZ...=1 X .IIF NB,SIZ, SIZ...=SIZ X .IF NB,SYM X MOD'SEP'V_'SYM=BIT... X`009EMIT`009MOD'SEP'V_'SYM,\MOD'SEP'V_'SYM X .if nb,siz XMOD'SEP'S_'SYM=SIZ X`009EMIT`009MOD'SEP'S_'SYM,\MOD'SEP'S_'SYM X .endc X .if nb,msk XMOD'SEP'M_'SYM=<<<1@SIZ...>-1>@BIT...> X`009EMIT`009MOD'SEP'M_'SYM,\MOD'SEP'M_'SYM X .endc X .ENDC X BIT...=BIT...+SIZ... X .ENDM $VIELD1 X .ENDM $GBLINI X$ X$! X$ assign/user _NL: SYS$ERROR`009`009`009!Avoid "No strings matched" X$ assign/user _NL: SYS$OUTPUT X$ search/nooutput 'p1'.'type' "%MACRO-" X$ if $severity .ne. 1 then goto fin X$ write SYS$ERROR "Error in producing ''p1'.''type' - file not usable." X$ write SYS$ERROR "(This probably means that there is no $",p1," macro.)" X$fin: X$ close/err=noerrdefs DEFS_MAR X$noerrdefs: X$ delete/nolog []defs.tmp; $ GOSUB UNPACK_FILE $ EXIT /* ---------- */