<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — Problem writing to file]]></title>
	<link rel="self" href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=686&amp;type=atom" />
	<updated>2018-08-28T16:10:09Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.approximatrix.com/viewtopic.php?id=686</id>
		<entry>
			<title type="html"><![CDATA[Re: Problem writing to file]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3175#p3175" />
			<content type="html"><![CDATA[<p>Hi Jeff, the print stmnt to the console works ok, I have it in place as&nbsp; a debugging tool. The write to unit 120 is what does not work ... unless I use the method I posted at 17:02:14 yesterday. I am ok with relocating the open and close stmnts but I think it should work the way I had it originally. In case you want them ... the following are the 3 input files. The follow are 3 examples of input lines for 3 receipts</p><p>0311&nbsp; 02&nbsp; 78.00 12&nbsp; 729&nbsp; tools<br />1231&nbsp; 10 10100&nbsp; 09&nbsp; 1152&nbsp; AC/heater<br />0922&nbsp; 08 215.23&nbsp; 04&nbsp; &nbsp;1258&nbsp; &nbsp;toilet</p><br /><br /><p>taxadd.txt</p><p>410<br />701<br />702<br />729<br />735<br />736g<br />736n<br />815<br />916<br />917<br />924<br />932<br />962<br />1147<br />1152<br />1258<br />24485<br />35846<br />20ac<br />times</p><br /><br /><br /><p>taxcat.txt</p><p>01 advertising<br />02 auto and travel<br />03 cleaning &amp; maint.<br />04 insurance<br />05 legal &amp; prof fees<br />06 management fees<br />07 mortgage interest<br />08 other interest<br />09 repairs<br />10 supplies<br />11 property taxes<br />12 utilities<br />13 other</p><br /><br /><br /><br /><p>taxvnd.txt</p><p>01 OSH <br />02 Home Depot<br />03 Lowes<br />04 Kelly Moore<br />05 BP Plumbin<br />06 Bestgreen<br />07 City of Sunnyvale<br />08 PGE<br />09 Sunnyvale Dumps<br />10 State Farm<br />11 Studio Drapery<br />12 Summerwinds<br />13 Santa Clara County<br />14 Yamagamis Nursery<br />15 US Postal<br />16 Verizon<br />17 Mtn View Garden<br />18 Melody Painting<br />19 Mr or Mrs Inzunza<br />20 Western Exterminators<br />21 CAA<br />22 Yard Bird Garden Equip<br />23 DMV<br />24 Foster Brothers<br />25 Office Depot</p>]]></content>
			<author>
				<name><![CDATA[imre_varga]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3807</uri>
			</author>
			<updated>2018-08-28T16:10:09Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3175#p3175</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem writing to file]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3169#p3169" />
			<content type="html"><![CDATA[<p>Imre,</p><p>There is no timeout on open files.&nbsp; I tried running your original code here, and, even without proper inputs, I did end up with it writing the date to the file properly.</p><p>When you say that it isn&#039;t writing to the output file, does your write statement:</p><div class="codebox"><pre><code>print *,&quot;Writing: &quot;,date,&quot;  &quot;,vendor,&quot;  &quot;,cost,&quot;  &quot;,taxcat,&quot;  &quot;,addres,&quot;  &quot;,desc</code></pre></div><p>show the proper information?&nbsp; My output simply said:</p><div class="codebox"><pre><code>Writing: 04/01</code></pre></div><p>based on my input string, as I expected.</p><p>I&#039;ll look into it more, though.&nbsp; I just haven&#039;t been able to replicate what you&#039;re seeing.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2018-08-28T11:53:51Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3169#p3169</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem writing to file]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3166#p3166" />
			<content type="html"><![CDATA[<p>Hi Jeff, I have been trying a few things if I do the following I can write to my outout file just fine:<br />&nbsp; &nbsp; &nbsp;open(unit=120,file=&quot;taxout1.txt&quot;,position=&quot;append&quot;,action=&quot;write&quot;,IOMSG=erroro,err=125,iostat=ir)<br />&nbsp; &nbsp; &nbsp;write (unit=120,fmt=123,err=125,iostat=ist) date,vendor,cost,taxcat,addres,desc<br />123&nbsp; format (5a1,1x,20a1,1x,8a1,1x,20a1,1x,20a1,1x,20a1)<br />&nbsp; &nbsp; &nbsp;close (unit=120,iomsg=errorc)</p><p>But if I open the file at program start up and close it at&nbsp; program end it does not write. Is there some sort of a timeout ???</p><br /><p>Imre</p>]]></content>
			<author>
				<name><![CDATA[imre_varga]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3807</uri>
			</author>
			<updated>2018-08-28T00:02:14Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3166#p3166</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem writing to file]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3165#p3165" />
			<content type="html"><![CDATA[<p>Hi Jeff, the entire program is a loop prompting the user for input ... once it has all of the input it writes a record to the output file, then it prompts the user for&nbsp; input again .... and so on.</p><p>the following is the program:</p><br /><br /><br /><br /><br /><p>program time4tax<br />implicit none<br />integer i,j,add1,k,cnt,l,m,i1,i2,taxcn,taxvn,addn,err,iostat,cerr,ivn,icn,ian,id4,id5<br />integer derr,verr,terr,aerr,serr,perr,dparsl,vparsl,vpars1l,ir,ist<br />&nbsp; &nbsp; character vparsc(8),vparst(16),vparsa(5),vparss(30),v13<br />&nbsp; &nbsp; integer ispace,isave1,isave2,scol,vi,cstart,db<br />&nbsp; &nbsp; integer isave3,isave4,isave5,isave6,vparscl,vparstl,vparsal,vparssl<br />character line(80)*1, date(5),vendor(20),cost(8),taxcat(20),vline(16)<br />character vndr(20),vndrs(25,20),v(50,20),taxcatg(25,20),taxadd(25,20)<br />character addres(20),desc(20),idate(5),dpars(5),vpars(16),vpars1(16),digng(12)<br />character c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,cc(10),b3*3,dte,iomsg*50,d3*3<br />character*50 erroro,errorc<br />&nbsp; &nbsp; common date,vendor,cost,b3,cstart,digng,taxvn,taxcatg,taxcat,taxadd,vndrs,db,addn,addres,desc,taxcn<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; digng(1)=&quot;1&quot;<br />&nbsp; &nbsp; digng(2)=&quot;2&quot;<br />&nbsp; &nbsp; digng(3)=&quot;3&quot;<br />&nbsp; &nbsp; digng(4)=&quot;4&quot;<br />&nbsp; &nbsp; digng(5)=&quot;5&quot;<br />&nbsp; &nbsp; digng(6)=&quot;6&quot;<br />&nbsp; &nbsp; digng(7)=&quot;7&quot;<br />&nbsp; &nbsp; digng(8)=&quot;8&quot;<br />&nbsp; &nbsp; digng(9)=&quot;9&quot;<br />&nbsp; &nbsp; digng(10)=&quot;0&quot;<br />&nbsp; &nbsp; digng(11)=&quot;.&quot;<br />&nbsp; &nbsp; digng(12)=&quot;$&quot;&nbsp; &nbsp; <br />&nbsp; &nbsp; open(unit=120,file=&quot;taxout1.txt&quot;,position=&quot;append&quot;,action=&quot;write&quot;,IOMSG=erroro,err=125,iostat=ir)<br />&nbsp; &nbsp; open(unit=107,file=&quot;taxvnd.txt&quot;,recl=80) <br />&nbsp; &nbsp; open(unit=108,file=&quot;taxcat.txt&quot;,recl=80)<br />&nbsp; &nbsp; open(unit=109,file=&quot;taxadd.txt&quot;,recl=80)<br />&nbsp; &nbsp; rewind 107<br />&nbsp; &nbsp; rewind 108<br />&nbsp; &nbsp; rewind 109<br />&nbsp; &nbsp; <br />!If db = 0 all debug msgs are off&nbsp; &nbsp;if db = 1 all msgs are on<br />&nbsp; &nbsp; db=0<br />&nbsp; &nbsp; <br />! blank out the 3 arrays<br />&nbsp; &nbsp; do 5 i=1,25<br />&nbsp; &nbsp; do 6 j=1,20<br />&nbsp; &nbsp; vndrs(i,j)=&quot; &quot;<br />&nbsp; &nbsp; taxcatg(i,j)=&quot; &quot;<br />&nbsp; &nbsp; if (j.le.5) taxadd(i,j)=&quot; &quot;<br />6&nbsp; &nbsp;CONTINUE<br />5&nbsp; &nbsp;continue<br />&nbsp; &nbsp; <br />!&nbsp; &nbsp;reading the tax.vndrs file into vndrs(i,j)&nbsp; <br />&nbsp; &nbsp; do i=1,25<br />&nbsp; &nbsp; do j=1,20<br />&nbsp; &nbsp; vndrs(i,j)=&quot; &quot;<br />&nbsp; &nbsp; end do<br />&nbsp; &nbsp; end do<br />&nbsp; &nbsp; do i=1,25<br />&nbsp; &nbsp; &nbsp;read (unit=107,fmt=227,end=903,err=919) (vndrs(i,j),j=1,20)<br />227 format (20a1)<br />&nbsp; &nbsp; end do<br />903 ivn=I-1<br />&nbsp; &nbsp; taxvn=i-1<br />&nbsp; &nbsp; <br />!&nbsp; &nbsp;do 332 i=1,taxvn<br />! 332&nbsp; &nbsp;print *,&quot;main vndrs=&quot;,(vndrs(i,j),j=1,20),&quot;&nbsp; i j=&quot;,i,j<br />!332&nbsp; &nbsp; &nbsp; write (*,866) (vndrs(i,j),j=1,20)&nbsp; <br />!866&nbsp; &nbsp;format (20o4)&nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <br />!&nbsp; &nbsp;reading the tax.catg file into taxcatg(i,j)<br />&nbsp; &nbsp; do i=1,25<br />&nbsp; &nbsp; do j=1,20<br />&nbsp; &nbsp; taxcatg(i,j)=&quot; &quot;<br />&nbsp; &nbsp; end do<br />&nbsp; &nbsp; end do<br />&nbsp; &nbsp; do i=1,25<br />&nbsp; &nbsp; read (unit=108,fmt=228,end=904,err=919) (taxcatg(i,j),j=1,20)<br />228 format (20a1)<br />&nbsp; &nbsp; end do<br />904 icn=i-1<br />&nbsp; &nbsp; taxcn=i-1<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; do i=1,25<br />&nbsp; &nbsp; do j=1,20<br />&nbsp; &nbsp; taxadd(i,j)=&quot; &quot;<br />&nbsp; &nbsp; end do<br />&nbsp; &nbsp; end do<br />!&nbsp; &nbsp;reading the tax.add file into taxadd(i,j)&nbsp; &nbsp;<br />&nbsp; &nbsp; do i=1,25<br />&nbsp; &nbsp; read (unit=109,fmt=229,end=905,err=919) (taxadd(i,j),j=1,20)<br />229 format (20a1)<br />&nbsp; &nbsp; end do<br />905 ian=i-1&nbsp; <br />&nbsp; &nbsp; addn=i-1</p><p>!&nbsp; &nbsp;read user entry, OUTPUT file format is --&gt; DATE&nbsp; &nbsp; &nbsp;Vendor&nbsp; &nbsp; &nbsp;COST&nbsp; &nbsp; &nbsp;TAX CATEGORY&nbsp; &nbsp; &nbsp;ADDRESS&nbsp; &nbsp; DESCRIPTION OF EXPENSE<br />!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5 cols&nbsp; &nbsp; 20 cols&nbsp; &nbsp;8 cols&nbsp; 2016 cols&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 20 cols&nbsp; &nbsp; &nbsp;20 co<br />&nbsp; &nbsp; print *,&quot; &quot;<br />&nbsp; &nbsp; print *,&quot;Time4tax written by Imre Varga, July 2018. Brought to you by Fun Software CopyWrite Aug. 2018 &quot;<br />&nbsp; &nbsp; print *,&quot; &quot;<br />&nbsp; &nbsp; print *,&quot;Please enter receipt information in the following input format.&quot;<br />&nbsp; &nbsp; print *,&quot;5&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;20&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;8&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;20&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;20&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;20&quot;<br />&nbsp; &nbsp; Print *,&quot;11111 22222222222222222222 33333333 44444444444444444444 55555555555555555555 66666666666666666666&quot;<br />&nbsp; &nbsp; print *,&quot;Date&nbsp; &nbsp; &nbsp; &nbsp;Vendor&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Cost&nbsp; &nbsp; &nbsp; Tax Category&nbsp; &nbsp; &nbsp; &nbsp;Address&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Description&quot;<br />&nbsp; &nbsp; print *,&quot;07/04&nbsp; &nbsp; &nbsp; OSH&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 42&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;01&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1147&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; New frontdoor lockset&quot;<br />&nbsp; &nbsp; print *,&quot;06-10&nbsp; &nbsp; &nbsp; 17&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$4.79&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 05&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 410&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; New toilet flapper&quot;<br />&nbsp; &nbsp; print *,&quot;0523&nbsp; &nbsp; &nbsp; &nbsp;3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 12.89&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 917&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Two drill bits&quot;<br />&nbsp; &nbsp; print *,&quot;0802&nbsp; &nbsp; &nbsp; &nbsp;Ace Hardware&nbsp; &nbsp; &nbsp; &nbsp; $300&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;8&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 729&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sunnyvale dumps&quot;<br />&nbsp; &nbsp; print*,&quot; &quot;<br />&nbsp; &nbsp; print *,&quot;There are &quot;,ivn,&quot; vendors.&quot;<br />&nbsp; &nbsp; print *,&quot;There are &quot;,icn,&quot; tax categories.&quot;<br />&nbsp; &nbsp; print *,&quot;There are &quot;,ian,&quot; addresses.&quot;<br />&nbsp; &nbsp; print *,&quot; &quot;<br />&nbsp; &nbsp; print *,&quot;Enter &#039;quit&#039; or &#039;exit&#039; to terminate program, &#039;?&#039; for help. &quot;<br />&nbsp; &nbsp; print *,&quot; &quot;<br />&nbsp; &nbsp; print *,&quot; &quot;<br />&nbsp; &nbsp; Print *,&quot; &quot;<br />111 continue&nbsp; &nbsp; <br />&nbsp; &nbsp; derr=0<br />&nbsp; &nbsp; verr=0<br />&nbsp; &nbsp; cerr=0<br />&nbsp; &nbsp; terr=0<br />&nbsp; &nbsp; aerr=0<br />&nbsp; &nbsp; serr=0<br />&nbsp; &nbsp; <br />811 print *,&quot;&nbsp; &nbsp;&quot;<br />&nbsp; &nbsp; print *,&quot;Date&nbsp; Vendor&nbsp; Cost&nbsp; Tax Category&nbsp; Address&nbsp; Description&quot;<br />&nbsp; &nbsp; read (*,1) line<br />1&nbsp; &nbsp;format(80a1)<br />&nbsp; &nbsp; <br />!&nbsp; &nbsp; if (line(1).eq.&quot;?&quot;) call sethlp<br />!&nbsp; &nbsp; if (line(1).eq.&quot;?&quot;) go to 999<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if (line(1).ne.&quot;?&quot;) go to 711<br />&nbsp; &nbsp; write (*,101)<br />101 format (///,&quot;Tax Categories&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Addresses&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Vendors&quot;)<br />&nbsp; &nbsp; do i=1,25&nbsp; <br />&nbsp; &nbsp; write (*,102) (taxcatg(i,j),j=1,20),(taxadd(i,j),j=1,20),(vndrs(i,j),j=1,20)<br />102 format (20a1,5x,20a1,7x,20a1)<br />&nbsp; &nbsp; END DO<br />&nbsp; &nbsp; go to 811<br />&nbsp; &nbsp; <br />711 continue<br />&nbsp; &nbsp; if ((line(1).eq.&quot;d&quot;).and.(line(2).eq.&quot;b&quot;).and.(line(3).eq.&quot;0&quot;)) db=0<br />&nbsp; &nbsp; if ((line(1).eq.&quot;d&quot;).and.(line(2).eq.&quot;b&quot;).and.(line(3).eq.&quot;1&quot;)) db=1<br />!&nbsp; &nbsp; if (db.eq.0) print *,&quot;Debug mode is off&quot;<br />!&nbsp; &nbsp; if (db.eq.1) print *,&quot;Debug mode is on&quot;<br />&nbsp; &nbsp; if ((line(1).eq.&quot;d&quot;).and.(line(2).eq.&quot;b&quot;).and.(line(3).eq.&quot;0&quot;)) go to 811<br />&nbsp; &nbsp; if ((line(1).eq.&quot;d&quot;).and.(line(2).eq.&quot;b&quot;).and.(line(3).eq.&quot;1&quot;)) go to 811<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if ((line(1).eq.&quot;q&quot;).and.(line(2).eq.&quot;u&quot;).and.(line(3).eq.&quot;i&quot;).and.(line(4).eq.&quot;t&quot;)) go to 999<br />&nbsp; &nbsp; if ((line(1).eq.&quot;e&quot;).and.(line(2).eq.&quot;x&quot;).and.(line(3).eq.&quot;i&quot;).and.(line(4).eq.&quot;t&quot;)) go to 999</p><p>25&nbsp; if (line(1) .eq. &quot; &quot;) go to 31<br />&nbsp; &nbsp; goto 30<br />31&nbsp; continue<br />&nbsp; &nbsp; cnt=80<br />&nbsp; &nbsp; do i=1,79<br />&nbsp; &nbsp; line(i)= line(i+1)<br />&nbsp; &nbsp; cnt=cnt-1<br />&nbsp; &nbsp; end do<br />&nbsp; &nbsp; go to 25<br />30&nbsp; continue<br />&nbsp; &nbsp; do i=1,79<br />36&nbsp; if ((line(i) .eq. &quot; &quot;) .and. (line(i+1) .eq. &quot; &quot;)) go to 33<br />&nbsp; &nbsp; go to 34<br />33&nbsp; continue<br />&nbsp; &nbsp; j=1<br />&nbsp; &nbsp; do j=i,79<br />&nbsp; &nbsp; line(j)=line(j+1)<br />&nbsp; &nbsp; end do<br />&nbsp; &nbsp; do k=i,80<br />&nbsp; &nbsp; if (line(k) .ne. &quot; &quot;) go to 36<br />&nbsp; &nbsp; end do<br />34&nbsp; end do<br />!&nbsp; &nbsp;do 3322 i=1,taxvn<br />!3322&nbsp; &nbsp;print *,&quot;b4 call parsim vndrs=&quot;,(vndrs(i,j),j=1,20),&quot;&nbsp; i j=&quot;,i,j<br />!&nbsp; do 3326 i=1,taxvn<br />! 3326&nbsp; print *,&quot;main vndrs=&quot;,(vndrs(i,j),j=1,20),&quot;&nbsp; i j=&quot;,i,j<br />!3326&nbsp; &nbsp; &nbsp; write (*,8661) (vndrs(i,j),j=1,20)&nbsp; <br />!8661&nbsp; &nbsp;format (10x,20o4)&nbsp; &nbsp; &nbsp;<br />&nbsp; <br />&nbsp; <br />&nbsp; </p><p>&nbsp; &nbsp; <br />&nbsp; <br />&nbsp; <br />&nbsp; <br />&nbsp; <br />&nbsp; <br />&nbsp; <br />&nbsp; <br />&nbsp; &nbsp; call parsin(line,perr,dpars,dparsl,vpars,vparsl,vparsc,vparscl,vparst,vparstl,vparsa,vparss,isave1,v13,vi)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />!&nbsp; &nbsp; print *,&quot;after sub parsin=&quot;,cost,&quot;XX&quot;<br />!&nbsp; &nbsp; write (*,2299) vendor,cost,date<br />!2299&nbsp; format(&quot;octal vendor=&quot;,20o4,5x,8o4,5x,5o4)</p><p>!&nbsp; do 3323 i=1,taxvn<br />! 332&nbsp; &nbsp;print *,&quot;main vndrs=&quot;,(vndrs(i,j),j=1,20),&quot;&nbsp; i j=&quot;,i,j<br />!3323&nbsp; &nbsp; &nbsp; write (*,8664) (vndrs(i,j),j=1,20)&nbsp; <br />!8664&nbsp; &nbsp;format (20x,20o4)&nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <br />8877 continue<br />&nbsp; &nbsp; print *,&quot;Writing: &quot;,date,&quot;&nbsp; &quot;,vendor,&quot;&nbsp; &quot;,cost,&quot;&nbsp; &quot;,taxcat,&quot;&nbsp; &quot;,addres,&quot;&nbsp; &quot;,desc<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp;write (unit=120,fmt=123,err=125,iostat=ist) date,vendor,cost,taxcat,addres,desc<br />123&nbsp; format (5a1,1x,20a1,1x,8a1,1x,20a1,1x,20a1,1x,20a1)<br />&nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />564 go to 111<br />&nbsp; &nbsp; <br />909 print *,&quot;read end EOF&quot;<br />&nbsp; &nbsp; go to 999<br />125 print *,&quot;Write err to file tax.data&quot;<br />&nbsp; &nbsp; go to 999<br />919 print *,&quot;read err&quot;<br />91&nbsp; continue<br />&nbsp; &nbsp; print *,(&quot;Open error on unit 120, err=&quot;),err<br />&nbsp; &nbsp; 999 continue</p><p>&nbsp; &nbsp; close (unit=120,iomsg=errorc)<br />&nbsp; &nbsp; <br />130&nbsp; &nbsp;if (err.ne.0) print *,&quot;Error occured closing unit 120 err=&quot;,err<br />&nbsp; &nbsp; &nbsp; if (iostat.ne.0) print *,&quot;Iostat error inn closing unit 4,iostat=&quot;,iostat<br />&nbsp; &nbsp; end program time4tax<br />&nbsp; &nbsp; <br />!===========================================================================&nbsp; &nbsp; </p><p>&nbsp; &nbsp; subroutine parsin (line,perr,dpars,dparsl,vpars,vparsl,vparsc,vparscl,vparst,vparstl,vparsa,vparss,isave1,v13,vi)<br />&nbsp; &nbsp; character line(80)*1,dpars(5),vpars(16),vpars1(16),digng(12),v13,date(5),vendor(20),cost(8),taxcd1,taxcd2<br />&nbsp; &nbsp; character vparsc(8),vparst(16),vparsa(5),vparss(30),taxcatg(25,20),taxcat(20),txcd1,txcd2,b3*3<br />&nbsp; &nbsp; character taxadd(25,20),vndrs(25,20),desc(20)<br />&nbsp; &nbsp; integer perr,dparsl,vparsl,vpars1l,ispace,isave1,isave2,scol,vi,cstart,taxcn,taxst,taxvn<br />&nbsp; &nbsp; integer isave3,isave4,isave5,isave6,vparscl,vparstl,vparsal,vparssl,bc,addn,addrs<br />&nbsp; &nbsp; common date,vendor,cost,b3,cstart,digng,taxvn,taxcatg,taxcat,taxadd,vndrs,db,addn,addres,desc,taxcn<br />&nbsp; &nbsp; character s1(20),s2(20),s3(20),s4(20),s5(20),s6(20),s7(20),s1tmp(5),s2tmp(2),addres(20),s4tmp(2)<br />&nbsp; &nbsp; integer s1len,s2len,s3len,s4len,s5len,s6len,s7len,s1st,s2st,s3st,s4st,s5st,s6st,s7st<br />&nbsp; &nbsp; integer s1end,s2end,s3end,s4end,s5end,s6end,s7end,idate,db&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />!&nbsp; &nbsp; &nbsp; &nbsp;do 3321 i=1,taxvn<br />! !3321&nbsp; &nbsp;print *,&quot;just in parsim vndrs=&quot;,(vndrs(i,j),j=1,20),&quot;&nbsp; i j=&quot;,i,j<br />!&nbsp; do 3320 i=1,taxvn<br />! 332&nbsp; &nbsp;print *,&quot;main vndrs=&quot;,(vndrs(i,j),j=1,20),&quot;&nbsp; i j=&quot;,i,j<br />!3320&nbsp; &nbsp; &nbsp; write (*,866) (vndrs(i,j),j=1,20)&nbsp; <br />!866&nbsp; &nbsp;format (&quot;in parsin beging&nbsp; &quot;,20o4)&nbsp; &nbsp; &nbsp;<br />!&nbsp; &nbsp; do 3329 ijk=1,taxvn<br />!&nbsp; &nbsp; write (*,3328) (vndrs(ijk,ix),ix=1,20)<br />!3328 format (&quot;write 3328 stmnt=&quot;,20a1)<br />!3329&nbsp; continue&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; do 4 i=1,20<br />&nbsp; &nbsp; s1(i)=&quot; &quot;<br />&nbsp; &nbsp; s2(i)=&quot; &quot;<br />&nbsp; &nbsp; s3(i)=&quot; &quot;<br />&nbsp; &nbsp; s4(i)=&quot; &quot;<br />&nbsp; &nbsp; s5(i)=&quot; &quot;<br />&nbsp; &nbsp; s6(i)=&quot; &quot;<br />&nbsp; &nbsp; vendor(i)=&quot; &quot;<br />&nbsp; &nbsp; taxcat(i)=&quot; &quot;<br />&nbsp; &nbsp; addres(i)=&quot; &quot;<br />&nbsp; &nbsp; desc(i)=&quot; &quot;<br />&nbsp; &nbsp; if (i.le.5) date(i)=&quot; &quot;<br />4&nbsp; &nbsp; if (i.le.8) cost(i)=&quot; &quot;<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; do 1087 i=1,132<br />&nbsp; &nbsp; if (line(i).ne.&quot; &quot;) go to 1087<br />&nbsp; &nbsp; s1st&nbsp; =1<br />&nbsp; &nbsp; s1end = i-1<br />&nbsp; &nbsp; s1len = s1end-s1st+1<br />&nbsp; &nbsp; iii=1<br />&nbsp; &nbsp; do 11 ii=s1st,s1end<br />&nbsp; &nbsp; s1(iii)=line(ii)<br />11&nbsp; iii=iii+1<br />&nbsp; &nbsp; go to 12<br />1087&nbsp; continue<br />12&nbsp; continue</p><p>&nbsp; &nbsp; s2st=i+1<br />&nbsp; &nbsp; do 23 i=i+1,132<br />&nbsp; &nbsp; if (line(i).ne.&quot; &quot;) go to 23<br />&nbsp; &nbsp; s2end = i-1<br />&nbsp; &nbsp; s2len = s2end-s2st+1<br />&nbsp; &nbsp; iii=1<br />&nbsp; &nbsp; do 21 ii=s2st,s2end<br />&nbsp; &nbsp; s2(iii)=line(ii)<br />21&nbsp; iii=iii+1<br />&nbsp; &nbsp; go to 22<br />23&nbsp; continue<br />22&nbsp; continue<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; s3st=i+1<br />&nbsp; &nbsp; do 30 i=i+1,132<br />&nbsp; &nbsp; if (line(i).ne.&quot; &quot;) go to 30<br />&nbsp; &nbsp; s3end = i-1<br />&nbsp; &nbsp; s3len = s3end-s3st+1<br />&nbsp; &nbsp; iii=1<br />&nbsp; &nbsp; do 31 ii=s3st,s3end<br />&nbsp; &nbsp; s3(iii)=line(ii)<br />31&nbsp; iii=iii+1<br />&nbsp; &nbsp; go to 32<br />30&nbsp; continue<br />32&nbsp; continue</p><p>&nbsp; &nbsp; s4st=i+1<br />&nbsp; &nbsp; do 40 i=i+1,132<br />&nbsp; &nbsp; if (line(i).ne.&quot; &quot;) go to 40<br />&nbsp; &nbsp; s4end = i-1<br />&nbsp; &nbsp; s4len = s4end-s4st+1<br />&nbsp; &nbsp; iii=1<br />&nbsp; &nbsp; do 41 ii=s4st,s4end<br />&nbsp; &nbsp; s4(iii)=line(ii)<br />41&nbsp; iii=iii+1<br />&nbsp; &nbsp; go to 42<br />40&nbsp; continue<br />42&nbsp; continue</p><p>&nbsp; &nbsp; s5st=i+1<br />&nbsp; &nbsp; do 50 i=i+1,132<br />&nbsp; &nbsp; if (line(i).ne.&quot; &quot;) go to 50<br />&nbsp; &nbsp; s5end = i-1<br />&nbsp; &nbsp; s5len = s5end-s5st+1<br />&nbsp; &nbsp; iii=1<br />&nbsp; &nbsp; do 51 ii=s5st,s5end<br />&nbsp; &nbsp; s5(iii)=line(ii)<br />51&nbsp; iii=iii+1<br />&nbsp; &nbsp; go to 52<br />50&nbsp; continue<br />52&nbsp; continue</p><p>&nbsp; &nbsp; s6st=i+1<br />&nbsp; &nbsp; do 60 i=i+1,132<br />&nbsp; &nbsp; if (line(i).ne.&quot; &quot;) go to 60<br />&nbsp; &nbsp; s6end = i-1<br />&nbsp; &nbsp; s6len = s6end-s6st+1<br />&nbsp; &nbsp; iii=1<br />&nbsp; &nbsp; do 61 ii=s6st,s6end<br />&nbsp; &nbsp; s6(iii)=line(ii)<br />61&nbsp; iii=iii+1<br />&nbsp; &nbsp; go to 62<br />60&nbsp; continue<br />62&nbsp; continue<br />!&nbsp; &nbsp;do 3032 i=1,taxvn<br />! !3032&nbsp; &nbsp;print *,&quot;492 vndrs=&quot;,(vndrs(i,j),j=1,20),&quot;&nbsp; i j=&quot;,i,j</p><p>!&nbsp; &nbsp; print *,&quot; &quot;<br />!&nbsp; &nbsp; print *,&quot;s1st=&quot;,s1st,&quot;&nbsp; s1end=&quot;,s1end,&quot;&nbsp; s1len=&quot;,s1len,&quot;&nbsp; s1=&quot;,s1<br />!&nbsp; &nbsp; print *,&quot;s2st=&quot;,s2st,&quot;&nbsp; s2end=&quot;,s2end,&quot;&nbsp; s2len=&quot;,s2len,&quot;&nbsp; s2=&quot;,s2<br />!&nbsp; &nbsp; print *,&quot;s3st=&quot;,s3st,&quot;&nbsp; s3end=&quot;,s3end,&quot;&nbsp; s3len=&quot;,s3len,&quot;&nbsp; s3=&quot;,s3<br />!&nbsp; &nbsp; print *,&quot;s4st=&quot;,s4st,&quot;&nbsp; s4end=&quot;,s4end,&quot;&nbsp; s4len=&quot;,s4len,&quot;&nbsp; s4=&quot;,s4<br />!&nbsp; &nbsp; print *,&quot;s5st=&quot;,s5st,&quot;&nbsp; s5end=&quot;,s5end,&quot;&nbsp; s5len=&quot;,s5len,&quot;&nbsp; s5=&quot;,s5<br />!&nbsp; &nbsp; print *,&quot;s6st=&quot;,s6st,&quot;&nbsp; s6end=&quot;,s6end,&quot;&nbsp; s6len=&quot;,s6len,&quot;&nbsp; s6=&quot;,s6</p><p>! Lets do some data type checking<br />! Date - check if all digits are 0-9 and an optional -or / quick chk of month and day, 5 digits max<br />! Vendor - any character string ok, if a vendor is manually entered it can be 2 words<br />!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; eachword can be up to 10 characters, a 2 digit vendor code can be entered<br />!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; which must have a match in taxvnd.txt<br />! Cost - needs to have digits 0-9 a period . and an optional $ sign, 10 digits max<br />! Tax category - 1 or 2 numeric digits, entry must be in taxcat.txt<br />! Address - any thing ok, but has to be a matching entry in taxadd.txt, 5 digits max<br />! Description - any character stringm up to 20 chars long</p><br /><p>! Start date check<br />!&nbsp; &nbsp; print *,&quot;start date chk&quot;,s1len,s1(1)<br />&nbsp; &nbsp; if (s1len.ge.6 .or. s1len.le.3) print *,&quot;Invalid Date&quot;<br />&nbsp; &nbsp; if (s1len.ge.6 .or. s1len.le.3) go to 410<br />&nbsp; &nbsp; do 880 i=1,5<br />880 s1tmp(i)=s1(i)<br />!&nbsp; &nbsp; print *,&quot;s1tmp+&quot;,s1tmp<br />&nbsp; &nbsp; if (s1len.eq.5) s1tmp(3)=s1(4)<br />&nbsp; &nbsp; if (s1len.eq.5) s1tmp(4)=s1(5)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; do 882 i=1,4<br />888&nbsp; &nbsp; do 881 j=1,10<br />!&nbsp; &nbsp; print *,&quot;s1tmp(i)=&quot;,s1tmp(i),&quot;&nbsp; &nbsp;digng(j)=&quot;,digng(j),&quot;&nbsp; &quot;,i,&quot;&nbsp; &quot;,j<br />!&nbsp; &nbsp; write (*,222) s1(i),digng(j)<br />!222&nbsp; format (o3,3x,o3)<br />&nbsp; &nbsp; if(s1tmp(i).eq.digng(j)) go to 415<br />881 continue<br />&nbsp; &nbsp; print *,&quot;invalid date&quot;<br />&nbsp; &nbsp; go to 410<br />415 continue<br />882&nbsp; continue<br />516 continue<br />&nbsp; &nbsp; if (s1tmp(1).ne.&quot;0&quot; .and. s1tmp(1).ne.&quot;1&quot;) print *,&quot;Invalid date&quot;<br />&nbsp; &nbsp; if (s1tmp(1).ne.&quot;0&quot; .and. s1tmp(1).ne.&quot;1&quot;) go to 410<br />&nbsp; &nbsp; if (s1len.eq.4.and.s1tmp(1).ne.&quot;0&quot;.and.s1tmp(1).ne.&quot;1&quot;.and.s1tmp(1).ne.&quot;2&quot;.and.s1tmp(1).ne.&quot;3&quot;) print *,&quot;invalid Date&quot;<br />&nbsp; &nbsp; if (s1len.eq.4.and.s1tmp(1).ne.&quot;0&quot;.and.s1tmp(1).ne.&quot;1&quot;.and.s1tmp(1).ne.&quot;2&quot;.and.s1tmp(1).ne.&quot;3&quot;) go to 410<br />&nbsp; &nbsp; date(1)=s1tmp(1)<br />&nbsp; &nbsp; date(2)=s1tmp(2)<br />&nbsp; &nbsp; date(3)=&quot;/&quot;<br />&nbsp; &nbsp; date(4)=s1tmp(3)<br />&nbsp; &nbsp; date(5)=s1tmp(04)<br />! !!&nbsp; &nbsp;print *,&quot;date=&quot;,date,&quot;XX&nbsp; s1tmp=&quot;,s1tmp,&quot;XX s1=&quot;,s1,&quot;XX&quot;<br />! Date check done</p><p>!Start vendor check<br />&nbsp; &nbsp;<br />!410&nbsp; continue&nbsp; &nbsp;error exit record<br />!417 continue&nbsp; &nbsp;fake out blank entry, put 3rd string as 4th string<br />!418 continue&nbsp; &nbsp;just an fyi, contiue<br />!Come to 420 if a 1 or 2 digit vendor code was entered<br />418 continue<br />417 continue<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if (s2len.eq.1) s2tmp(1)=&quot;0&quot;<br />&nbsp; &nbsp; if (s2len.eq.1) s2tmp(2)=s2(1)<br />&nbsp; &nbsp; if (s2len.eq.2) s2tmp(1)=s2(1)<br />&nbsp; &nbsp; if (s2len.eq.2) s2tmp(2)=s2(2)<br />!&nbsp; &nbsp; print *,&quot;s2len=&quot;,s2len,&quot;&nbsp; s2tmp(1)&quot;,s2tmp(1),&quot;&nbsp; s2tmp(2)=&quot;,s2tmp(2),&quot;&nbsp; s2(1)=&quot;,s2(1),s2(2),&quot;&nbsp; &nbsp;s2st=&quot;,s2st<br /> do i=1,10<br />&nbsp; &nbsp; if (s2tmp(1).eq.digng(I)) go to 425<br />&nbsp; &nbsp; end do<br />&nbsp; &nbsp; Print *,&quot;Invalid vendor code.&quot;<br />&nbsp; &nbsp; go to 410<br />425 continue&nbsp; &nbsp; <br />&nbsp; &nbsp;do i=1,10<br />!&nbsp; &nbsp;print *,s2tmp(1),&quot;xx&quot;,digng(i),&quot;XX&quot;,s2tmp(2),&quot;XX&quot;<br />&nbsp; &nbsp; if (s2tmp(2).eq.digng(I)) go to 4251<br />&nbsp; &nbsp; end do<br />&nbsp; &nbsp; Print *,&quot;Invalid Vendor code&quot;<br />&nbsp; &nbsp; go to 410<br />4251 continue <br />! Vendor check done&nbsp; &nbsp; <br />!&nbsp; &nbsp; &nbsp; &nbsp;do 33002 i=1,taxvn<br />! 33002&nbsp; &nbsp;print *,&quot;4251 vndrs=&quot;,(vndrs(i,j),j=1,20),&quot;&nbsp; i j=&quot;,i,j<br />! Start cost check</p><p>&nbsp; &nbsp; do 443 i=1,s3len&nbsp; &nbsp; <br />&nbsp; &nbsp; do 444 j=1,11<br />!&nbsp; &nbsp; print *,&quot;s3(i)=&quot;,s3(i),&quot;&nbsp; digng(j)=&quot;,digng(j),&quot;&nbsp; i=&quot;,i,&quot;&nbsp; &nbsp;j=&quot;,j,j<br />&nbsp; &nbsp; if (s3(i).eq.digng(j)) go to 443<br />444&nbsp; continue<br />&nbsp; &nbsp; print *,&quot;Invalid cost was entered&quot;<br />&nbsp; &nbsp; go to 410<br />443 continue<br />&nbsp; &nbsp; &nbsp; &nbsp; cost(1)=&quot;$&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; do 3021 i=2,8 <br />&nbsp; &nbsp; 3021&nbsp; cost(i)=&quot; &quot;<br />&nbsp; <br />&nbsp; &nbsp; &nbsp;do 456 i=1,8-s3len<br />456&nbsp; cost(i)=&quot; &quot;<br />&nbsp; &nbsp; &nbsp; do 457 j=1,s3len<br />!&nbsp; &nbsp; &nbsp; print *,&quot;j=&quot;,j,&quot;&nbsp; s3len=&quot;,s3len,&quot;&nbsp; s3(j)=&quot;,s3(j),&quot;&nbsp; Cost(8-s3len+j)=&quot;,cost(8-s3len+j)<br />457&nbsp; &nbsp; &nbsp;cost(8-s3len+j)=s3(j) <br />&nbsp; &nbsp; <br />!&nbsp; &nbsp; &nbsp; print&nbsp; *,&quot;COST=&quot;,cost,&quot;&nbsp; s3len=&quot;,s3len,&quot;&nbsp; s3st=&quot;,s3st<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<br />426 continue<br />&nbsp; &nbsp; <br />422 continue<br /> 410 continue&nbsp; &nbsp;<br />! cost chk done&nbsp; &nbsp; <br />!go to 765<br />! get the vendor descriptopn from the vendor code</p><p>!&nbsp; &nbsp; do 332 i=1,taxvn<br />! 332&nbsp; &nbsp;print *,&quot;332 vndrs=&quot;,(vndrs(i,j),j=1,20),&quot;&nbsp; i j=&quot;,i,j</p><p>!&nbsp; &nbsp; write (*,665)vendor<br />!665&nbsp; format(20o4)<br />&nbsp; &nbsp; do 887 jj=1,20<br />&nbsp; &nbsp; 887&nbsp; &nbsp;vendor(jj)=&quot; &quot;<br />&nbsp; &nbsp; <br />!!&nbsp; &nbsp; write (*,987) vendor<br />&nbsp; &nbsp; do i=1,taxvn<br />&nbsp; &nbsp; <br />!&nbsp; &nbsp; write (*,665) vendor<br />&nbsp; &nbsp; <br />!0&nbsp; &nbsp; print *,&quot;s5(s5st)=&quot;, s5(s5st),&quot;&nbsp; vndrs(i,1)=&quot;,vndrs(i,1),&quot;&nbsp; s5(s5st+1)=&quot;,s5(s5st+1),&quot;&nbsp; vndrs(i,2)=&quot;,vndrs(i,2)<br />!&nbsp; &nbsp; print *,&quot; s2(1)=&quot;,s2(1),&quot;&nbsp; vndrs(i,1)=&quot;,vndrs(i,1),&quot;&nbsp; s2(2)=&quot;,s2(2),&quot;&nbsp; vndrs(i,2)=&quot;,vndrs(i,2),&quot;&nbsp; i=&quot;,i<br />&nbsp; &nbsp; if (s2tmp(1).eq.vndrs(i,1) .and. s2tmp(2).eq.vndrs(i,2)) go to 389<br />&nbsp; &nbsp; end do<br />&nbsp; &nbsp; print * ,&quot;The specified vendor num does not have an entry in the vendor file, vendor num will be used =&gt;&quot;,vendor(1),vendor(2)<br />&nbsp; &nbsp; go to 765<br />389 do j=1,17<br />&nbsp; &nbsp; vendor(j)=vndrs(i,j+3)<br />&nbsp; &nbsp; end do </p><p>390&nbsp; continue <br />!&nbsp; &nbsp; print *, &quot;VENDOR=&quot;,vendor<br />!&nbsp; &nbsp; write(*,987) vendor<br />!&nbsp; &nbsp; 987&nbsp; format (20o3)<br />!&nbsp; &nbsp; write (*,665) vendor<br />! lets get the tax category </p><p>&nbsp; &nbsp; if (s4len.eq.1) s4tmp(1)=&quot;0&quot;<br />&nbsp; &nbsp; if (s4len.eq.1) s4tmp(2)=s4(1)<br />&nbsp; &nbsp; if (s4len.eq.2) s4tmp(1)=s4(1)<br />&nbsp; &nbsp; if (s4len.eq.2) s4tmp(2)=s4(2)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp;do i=1,10<br />!&nbsp; &nbsp; &nbsp;print *,&quot;s4tmp(1)=&quot;,s4tmp(1),&quot;&nbsp; digng(i)=&quot;,digng(i)<br />&nbsp; &nbsp; if (s4tmp(1).eq.digng(I)) go to 4125<br />&nbsp; &nbsp; end do<br />&nbsp; &nbsp; Print *,&quot;Invalid vendor code.&quot;<br />&nbsp; &nbsp; go to 410<br />4125 continue&nbsp; &nbsp; <br />&nbsp; &nbsp;do i=1,10<br />!&nbsp; &nbsp;print *,&quot;in 4125 loop&nbsp; &nbsp;s4tmp(2)=&quot;,s4tmp(2),&quot;xx digng(i)=&quot;,digng(i),&quot;XX&quot;,s2tmp(2),&quot;XX&quot;<br />&nbsp; &nbsp; if (s4tmp(2).eq.digng(I)) go to 4253<br />&nbsp; &nbsp; end do<br />&nbsp; &nbsp; Print *,&quot;Invalid Vendor code&quot;<br />&nbsp; &nbsp; go to 410<br />4253 continue<br />!&nbsp; &nbsp; print *,&quot;XXXXXXXXXXXXXXXXXXXXXX&nbsp; &nbsp;taxcn=&quot;,taxcn<br />&nbsp; &nbsp; &nbsp;do i=1,taxcn<br />&nbsp; &nbsp; &nbsp;<br />!&nbsp; &nbsp; &nbsp;print *,&quot;s4tmp(1)=&quot;,s4tmp(1),&quot;&nbsp; s4tmp(2)=&quot;,s4tmp(2),&quot;&nbsp; taxcatg(i,1)=&quot;,taxcatg (i,1),&quot;&nbsp; taxcatg(i,2)=&quot;,taxcatg(i,2)<br />&nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; if (s4tmp(1).eq.taxcatg(i,1) .and. s4tmp(2).eq.taxcatg(i,2)) go to 3897<br />&nbsp; &nbsp; end do <br />&nbsp; &nbsp; print * ,&quot;The specified tax category num does not have an entry in the tax category file, schedule e 1040&quot;<br />&nbsp; &nbsp; go to 3907<br />3897 do j=1,17<br />!&nbsp; &nbsp; print *,&quot;taxcat(j)=&quot;,taxcat(j),&quot;&nbsp; &nbsp;taxcatg(i,j+3)=&quot;, taxcatg(i,j+3)<br />&nbsp; &nbsp; taxcat(j)=taxcatg(i,j+3)<br />&nbsp; &nbsp; end do <br />3907&nbsp; continue <br />!&nbsp; &nbsp; &nbsp;print *,&quot;taxcat===&quot;,taxcat</p><p>!&nbsp; &nbsp; set up descriptiom<br />&nbsp; &nbsp; &nbsp; do i=1,20<br />&nbsp; &nbsp; &nbsp; desc(i)=s6(i)<br />&nbsp; &nbsp; &nbsp; end do</p><p> ! check to make sure address is valid<br />!&nbsp; &nbsp; &nbsp; &nbsp; do i=1,25<br />!&nbsp; &nbsp; &nbsp; &nbsp; write (*,776) (taxadd(i,j),j=1,20)&nbsp; &nbsp; &nbsp; &nbsp;<br />! 776&nbsp; &nbsp;format (&quot;house num&quot;,20a1)&nbsp; &nbsp; &nbsp; &nbsp;<br />!&nbsp; &nbsp; &nbsp; &nbsp; end do</p><p>&nbsp; &nbsp; do 549 k=1,addn<br />&nbsp; &nbsp; j=0<br />&nbsp; &nbsp; do 1009 i=1,s5len<br />&nbsp; &nbsp; <br />!&nbsp; &nbsp; print *,&quot;taxadd(k,i)=&quot;,taxadd(k,i),&quot;&nbsp; s5(i)=&quot;,s5(i),&quot;&nbsp; i=&quot;,i,&quot;&nbsp; k=&quot;,k,&quot;&nbsp; s5len=&quot;,s5len<br />&nbsp; &nbsp; if (taxadd(k,i).eq.s5(i)) j=j+1<br />1009&nbsp; &nbsp; if (j.eq.s5len) go to 15<br />549&nbsp; &nbsp;continue<br />&nbsp; &nbsp; print *,&quot;Address not found,enter ? for list of valid addresses&quot;</p><p>15 continue<br />&nbsp; &nbsp; <br />!&nbsp; &nbsp; &nbsp;write (*,1611) s5<br />!1611&nbsp; &nbsp; format(&quot;FINAL VALUE OF ADDRES(1-5)=&quot;,20a1)<br />&nbsp; &nbsp; addres(1)=s5(1)<br />&nbsp; &nbsp; addres(2)=s5(2)<br />&nbsp; &nbsp; addres(3)=s5(3)<br />&nbsp; &nbsp; addres(4)=s5(4)<br />&nbsp; &nbsp; addres(5)=s5(5)&nbsp; &nbsp;<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; 765&nbsp; continue<br />&nbsp; &nbsp; <br />8888 continue<br />699&nbsp; continue <br />822&nbsp; continue<br />&nbsp; &nbsp; &nbsp;return<br />&nbsp; &nbsp; &nbsp;end</p>]]></content>
			<author>
				<name><![CDATA[imre_varga]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3807</uri>
			</author>
			<updated>2018-08-27T21:11:52Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3165#p3165</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem writing to file]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3164#p3164" />
			<content type="html"><![CDATA[<p>Imre,</p><p>Is there some conditional or loop controlling writing to unit 120, a.k.a. <em>taxout1.txt</em>?&nbsp; There&#039;s not much to go on in this two line snippet you&#039;ve provided. </p><p>Also, you&#039;re missing a closing parentheses on the write statement, but I assume that is only a copy/paste issue.</p><p>-Jeff</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2018-08-27T12:04:46Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3164#p3164</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Problem writing to file]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3163#p3163" />
			<content type="html"><![CDATA[<p>I am running SF on a Windows 7.1 system. My code runs fine except when it comes to writing to an output file. I get no errors from the open or the write. Every once in a while it works briefly, it worked ok on Aug 19 and it worked ok about a week before that. When I erase the output file, the open statement will create a new taxout.txt file but no records are written to it. </p><p>This is the open and write statemets I use.</p><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;open(unit=120,file=&quot;taxout1.txt&quot;,position=&quot;append&quot;,action=&quot;write&quot;,IOMSG=erroro,err=125,iostat=ir)<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; write (unit=120,fmt=123,err=125,iostat=ist) date,vendor,cost,taxcat,addres,desc<br />123&nbsp; &nbsp; &nbsp;format (5a1,1x,20a1,1x,8a1,1x,20a1,1x,20a1,1x,20a1)</p><br /><br /><p>Thanks, Imre</p>]]></content>
			<author>
				<name><![CDATA[imre_varga]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3807</uri>
			</author>
			<updated>2018-08-26T15:46:19Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3163#p3163</id>
		</entry>
</feed>
