<br><br>
<div class="gmail_quote">On Tue, Jun 17, 2008 at 8:10 AM, Wayne Dunlop <<a href="mailto:wayne.dunlop@gmail.com">wayne.dunlop@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<p>;------------------------------------------------<br>;CREATION TAB DELIMITED FILE<br>;------------------------------------------------</p>
<p>CAN CLE<br>SET DEF</p>
<p>ACCESS MY-FILE</p>
<p>DEF TBL-NUM INT SIZ 2 = 9<br>DEF TBL CHAR * 1 = CHAR(TBL-NUM)[2:1]</p>
<p>SET REP LIM 2000</p>
<p>;Define the tab file header, i.e. line 1.<br>;This header line will be positioned on top by using INITIAL HEADING.<br>;----------------------------------------<br>DEF HEADER CHAR * 50 = &,<br>PACK ( &,<br>
"OPERATIONCODE" + TBL + &,<br> "OPERATIONNAME" + TBL + &,<br> "VALUE" + TBL + "X" )</p>
<p> </p>
<p><br>;Define the content of the data lines<br>;----------------------------------------<br>DEF PACKET CHAR * 50 = &,<br>TRUNC( FIELD-2 ) + TBL + &,<br>TRUNC( FIELD-2LABEL ) + TBL + &,<br>
TRUNC( ASC(VALUE) ) + TBL + "X"</p>
<p>;The extra "X" is an added precaution to get rid of any trailing spaces.<br>;Any spaces will be located in the X field which you won't use anyaway.</p>
<p><br>:PURGE TABFILE.YYY<br>SET REP DEV DISC NAME TABFILE</p>
<p>SET NOHEAD<br>INITIAL HEADING HEADER</p>
<p>SET PAGE LEN 0<br>SET PAGE WID 256<br>SET REP SPA 0</p>
<p>REP PACKET</p>
<p>GO</p>
<p><br>---------------------------------------<br>example with a text field<br>example with a date<br>example with a currency (money with 2 decimals)<br>------------------------- --------------<br>DEF MY-TAB-NUM INT SIZ 2 = 9<br>
DEF MY-TAB CHAR * 1 = CHAR(MY-TAB-NUM)[2:1]</p>
<p><br>def packet char * 200 = &,<br>pack ( Sometextfield + MY-TAB + &,<br> asc(quizdate,8)[7:2] + "/" + &,<br> asc(quizdate,8)[5:2] + "/" + &,<br>
asc(quizdate,8)[1:4] + MY-TAB + &,<br> asc(moneyfield,10)[1:8] + "." + &,<br> asc(moneyfield,10)[9:2] + MY-TAB + &,<br> "X" )</p>
<div>-----</div>
<div>With thanks to all those Quizards who showed me how to do that in days gone by.</div>
<div>Wayne</div><font color="#888888">
<div> </div>
<div> </div></font></blockquote></div><br>