Creating a fixed length record in Progress v7.3

Creating a fixed length record in Progress v7.3

Post by Tom Faus » Thu, 08 Jan 1998 04:00:00



I am trying to dump a fixed length record to a data file using Progress
v7.3.

Any suggestions on the best way to do this?

Thanks

 
 
 

Creating a fixed length record in Progress v7.3

Post by Carlos Fazendeir » Thu, 08 Jan 1998 04:00:00



Quote:>I am trying to dump a fixed length record to a data file using Progress
>v7.3.

>Any suggestions on the best way to do this?

>Thanks

------------------------------------------------------------------
def stream outfile.
output stream outfile to c:\temp\a.txt.

def var buf as char no-undo.

for each my_file:
   buf = string( field1 , "X(16)" )
         + string( field2 , "X(20)" )
         + string( field3 ,"zzzzz9.99").

  put stream outfile unformatted buf skip.

end.
output stream outfile close.

You can also use :
     buf = fill(" ",80).
     overlay(buf,1,16) = field1.
     overlay(buf,17,20) = field2.
     overlay(buf,37,9) = string(field3 ,"zzzzz9.99").
     put unformatted buf skip.

Also, look at substring statement:

Carlos Fazendeiro

LABEL Systemes : www.groupelabel.com

 
 
 

1. Creating Fixed-Record Length Text File - PL/SQL Command File

I am creating a fixed-record length text file using a PL/SQL Developer
Command File as listed below (similar to SQL Plus script).  My output
file has an extra four spaces at the end of each record after the
numberic field (A.POSTED_TOTAL_AMT).  I've tried using the RTRIM
function and other methods, but I can't get rid of the four spaces.
Any ideas?

SET TERMOUT ON

ACCEPT FiscalYear NUMBER PROMPT 'Enter fiscal year:'
PROMPT Building Census expenditure data file...

SET TERMOUT OFF
SET FEEDBACK OFF
SET HEADING OFF
SET PAGESIZE 0
SET SPACE 0

SPOOL H:\Census\Mt02exp.txt

SELECT A.BUSINESS_UNIT || B.PROGRAM_VALUE_N || RPAD(A.ACCOUNT,6,' ')
||
       TO_CHAR(ROUND(SUM(A.POSTED_TOTAL_AMT),0),'S000000000009')
  FROM PS_LEDGER A, PS_SUBCLASS_XWLK_N B
 WHERE B.EFFDT =
       (SELECT MAX(EFFDT) FROM PS_SUBCLASS_XWLK_N
         WHERE B.SETID = SETID
           AND B.APPROPRIATION_NBR = APPROPRIATION_NBR
           AND EFFDT <= TO_DATE('30-JUN-' || &FiscalYear))
   AND B.SETID = 'STATE'
   AND A.APPROPRIATION_NBR = B.APPROPRIATION_NBR
   AND (A.LEDGER = 'ACTUALS'
   AND A.ACCOUNT LIKE '6%'
   AND A.FISCAL_YEAR = &FiscalYear
   AND A.ACCOUNTING_PERIOD <> 999)
 GROUP BY A.BUSINESS_UNIT, B.PROGRAM_VALUE_N, A.ACCOUNT
HAVING SUM(A.POSTED_TOTAL_AMT) <> 0;

SPOOL OFF

2. class recommendations in D.C., Virginia area???

3. BCP OUT Fixed-Length Record: Truncated Length

4. pgsql/src backend/po/zh_CN.po bin/pg_dump/zh_C ...

5. Question on bulk loading of fixed length/fixed field records

6. Using Exec

7. Unload V7 Record Length

8. MDT2G.dll problem when try create a table

9. Problem when importing in Fixed length file with Header Record

10. export to fixed length record

11. Fixed Record Length data

12. Load fixed length records.

13. Creating a database w/o fixed length strings