|
I have been asked to create a "Tab Delimited" file for download. Can this be done in (any flavor of) RPG? If so - how????
H DFTACTGRP(*NO)
FITMMAST IF E DISK
/copy ifsio_h
D fd s 10I 0 D IfsData s 32767A varying D TAB c x'05' D CRLF c x'0d25'
/free
fd = open( '/tmp/itemdata.tab' : O_WRONLY + O_TRUNC + O_CREAT + O_CCSID + O_TEXTDATA + O_TEXT_CREAT : M_RDWR : 1252 : 0 );
if (fd < 0); // file open failed. Check __errno() to find out // why, then notify user. endif;
read ITMMAST; dow not %eof(ITMMAST);
IfsData = %char(SKU) + TAB + %trimr(ItemDesc) + TAB + %char(Weight) + TAB + %trimr(SalesRepName) + CRLF;
callp write(fd: %addr(IfsData)+2: %len(IfsData));
read ITMMAST; enddo;
callp close(fd); *inlr = *on;
/end-free
You can get the /copy member (IFSIO_H) from my Web site at: http://www.scottklement.com/rpgandbeyond04/
I've also written a tutorial on IFS programming, which you can read at http://www.scottklement.com/rpg/ifs.html
Or must this be done using CPYTOIMPF to a file in IFS?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.