If you have Suprtool it grabs the data and creates CSV files using STExport
very nice.
Otherwise in Quiz I have this use file:
;############################################################
; VALLEY PRESBYTERIAN HOSPITAL
;
; SOURCE NAME : DOWNLOAD.VPHU
;
; FILES ACCESSED : NONE
;
; ELEMENTS ACCESSED : NONE
;
; PROGRAM DESCRIPTION : DEFINIATIONS FOR DOWNLOADED PRN FILES
;
; PROGRAMMER : CATHERINE L. LITTEN
;
; DATE ENTERED PRODUCTION : 1997/08/12
;
;############################################################
DEFINE QUOTE CHAR*1 = '"'
DEFINE COMMA CHAR*1 = ','
DEFINE TEXT CHAR*3 = '","'
DEFINE TEXT-NUM CHAR*2 = '",'
DEFINE NUM-TEXT CHAR*2 = ',"'
*******************************************
Then I call it in a Quiz file like this:
*******************************************
;************************************************************
; VALLEY PRESBYTERIAN HOSPITAL
;
; SOURCE NAME : PPR715VS.VPHS
;
; PASS DESCRIPTION : build PORTABLE SUBFILE
;*************************************************************
:purge PPR715V1.VPHD
:purge PPR715VQ.VPHD
access *PPR715K1.VPHD &
link (ENTITY-ID + char(LINK-DEPT)) &
to E-DEPT-NBR of DEPARTMENTS
define STAYED char*1 = "Y" if NEW-TOTAL = 1 else " "
define TIME-PERDEIM char*10 = TIME-DESC if TIME-DESC = "PER-DEIM" else &
TIME-DESC if TIME-DESC = "UNKNOWN" else "NORMAL"
; Following defines Quote, Comma, Text, Text-Num, num-Text Items
use DOWNLOAD.VPHU nolist
sort on TIME-PERDEIM &
on STAYED
set report limit 100000
set subfile portable name PPR715V1.VPHD keep size 100000
report summary &
EMP-NBR &
COMMA &
LINK-DEPT &
num-TEXT &
DEPT-DESC &
TEXT &
CATG-DESC &
TEXT &
TIME-PERDEIM &
TEXT &
STAYED &
TEXT-NUM &
LENGTH-EMPLOYED &
num-TEXT &
JOBCLASS &
TEXT &
GOOD-STATUS &
TEXT-NUM &
TIME-SORT &
COMMA &
START-DATE &
COMMA &
END-DATE
build PPR715VC.VPHC display "VER 008 VPH 1999/04/04 (ALT 7)"
Hope this helps,
Cat Litten
Ours is the age that is proud of machines that think and suspicious of men
who try to. - H. Mumford Jones
-----Original Message-----
From: HP-3000 Systems Discussion [mailto:[log in to unmask]]On
Behalf Of kellie Jones
Sent: Wednesday, March 07, 2007 9:53 AM
To: [log in to unmask]
Subject: Create a CSV file
I've read the archives - and the only info I can find on CSV files is
converting
to fixed from a csv file.
I was wondering if there was a way to create a *real* csv file on the 3000.
I don't have many resources - I can create a csv file with COBOL or with
QUIZ. What they really are is a fixed length file with commas in between the
fields. Problem is, if you open the file up in excel - there are extra
spaces, and
it doesn't handle it correctly (you can see the data fine - but if you need
to
load it into a database or do a lookup - it includes the trailing spaces).
I'd
have to do a trim in excel and re-save the file to get rid of the spaces.
Is there a way to do this in COBOL or even just from the OS?
tia
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|