cat > script.ff <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
	program typf3
	integer error,comp
EXEC SQL INCLUDE SQLCA;
EXEC SQL BEGIN DECLARE SECTION ;
	character  *25 	v_char
	integer	*SIZE_OF_C_LONG	v_int1
	integer	*SIZE_OF_C_SHORT v_int2
	integer	*SIZE_OF_C_LONG	v_longint
	real		v_real1
	real	*4	v_real2
	real	*8	v_real3
	double precision	v_double
EXEC SQL END DECLARE SECTION ;
EXEC SQL INIT;
EXEC SQL DATABASE IS "DATABASE";
EXEC SQL DECLARE c CURSOR FOR SELECT FROM type
   FOR UPDATE OF a_char,a_int,a_longint,a_real,a_double;
EXEC SQL OPEN c;
	if(SQLRET.NE.0) then
	error=1
	goto 10
	endif
50	continue 
	EXEC SQL FETCH c a_char,a_int,a_longint,a_longint,
	   a_real,a_float,a_double,a_double
	   INTO :v_char,:v_int2,:v_int1,:v_longint,
	   :v_real1,:v_real2,:v_real3,:v_double;
	if(SQLRET.EQ.0) then
	write (*,101) v_char,v_int1,v_int2,v_longint
 101    format (' ', A25,I10,I10,I10)
	write (*,102) v_real1,v_real2,v_real3,v_double
 102    format (' ', F18.6,F18.6,F18.6,F18.6)
	if(comp('char1',v_char,5).EQ.0) then
	v_int2 = v_int1 + 10000
	v_longint = v_longint + 1000000
	v_real1 = v_real1 + 1000000
	v_double = v_double + 1000000
EXEC SQL UPDATE type SET a_char="char2",a_int=:v_int2,a_longint=:v_longint,
	   a_real=:v_real1,a_double=:v_double WHERE CURRENT OF c;
	print *,'update ok'
	else
EXEC SQL DELETE FROM type WHERE CURRENT OF c;
	if(SQLRET.NE.0) then
	error=3
	goto 10
	endif
	print *,'delete ok'
	endif
	goto 60
	endif
	if(SQLRET.EQ.100) goto 60
	if(SQLRET.EQ.1) then
	print *,' lock busy'
	goto 60
	endif
	error=4
	goto 10
60	if(SQLRET.EQ.0) goto 50
EXEC SQL CLOSE c;
	v_int2 = 500
	v_longint = 50000
	v_real1 = 5000000
	v_double = 500000000
EXEC SQL INSERT INTO type SET a_char,a_int,a_longint,a_real,a_double
	   VALUES "char3",:v_int2,:v_longint,:v_real1,:v_double;
	if(SQLRET.NE.0) then
	error=5
	goto 10
	endif
	print *,'insert ok'
EXEC SQL OPEN c;
	if(SQLRET.NE.0) then
	error=6
	goto 10
	endif
150	continue 
	EXEC SQL FETCH c a_char,a_int,a_longint,a_longint,
	   a_real,a_float,a_double,a_double
	   INTO :v_char,:v_int2,:v_int1,:v_longint,
	   :v_real1,:v_real2,:v_real3,:v_double;
	if(SQLRET.EQ.0) then
	write (*,101) v_char,v_int1,v_int2,v_longint
	write (*,102) v_real1,v_real2,v_real3,v_double
	goto 160
	endif
	if(SQLRET.EQ.100) goto 160
	if(SQLRET.EQ.1) then
	print *,' lock busy'
	goto 160
	endif
	error=7
	goto 10
160	if(SQLRET.EQ.0) goto 150
	EXEC SQL CLOSE c;
EXEC SQL EXIT ;
	stop
10	print *,'error number ',error
	print *,'SQLRET number ',SQLRET
EXEC SQL EXIT ;
	stop
	end

	integer function comp(st1,st2,length)
	character*(*) st1,st2
	integer length
	comp=0
	do 20 i=1,length
		if(st1(i:i).NE.st2(i:i)) comp=comp+1
20	continue
	return
	end
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 script.ff
cat > sizelong.c <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
main ()
{
	printf ("%d\n", sizeof (long));
}
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 sizelong.c
cat > stdout <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
char1                         10000       100     10000
123.000000   12345000.000000   12345678.900000   12345678.900000
update ok
char                          20000       200     20000
321.000000   54321000.000000   98765432.100000   98765432.100000
delete ok
insert ok
char2                       1010000     20000   1010000
1000123.000000   12345000.000000   13345678.900000   13345678.900000
char3                         50000       500     50000
5000000.000000   12345000.000000  500000000.000000  500000000.000000
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 stdout
cat > tag <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
internal format (integer,float)
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 tag
