|
CPYFRMSTMF is the main command you want. Below is a procedure that copies a
cd file to a db file that we use.
Scott Mildenberger
p cpy_cd b export
d cpy_cd pi like(msg_t)
d from_cdfile 30 const varying
d to_dbfile 10 const
d cmpfile s like(from_cdfile)
d found s n
*** Determine the comparing string, if the last character is '*'
*** then only compare up to that position, otherwise compare all
*** 30 positions to force exact match.
c if %subst(from_cdfile :
c %len(%trim(from_cdfile)) : 1) = '*'
c eval cmpfile = %subst(from_cdfile : 1 :
c %len(%trim(from_cdfile)) - 1)
c else
c eval %len(cmpfile) = 30
c eval cmpfile = *blanks
c movel from_cdfile cmpfile
c endif
*** Do DSPFD to an outfile to find the record length of the PF.
c if syscall('dspfd file(' + to_dbfile +
c ') ' +
c 'type(*rcdfmt) output(*outfile)'+
c ' outfile(qtemp/dspfd_out)')
c <> *blanks
c return syscallerr
c endif
c if syscall('ovrdbf file(qafdrfmt) ' +
c 'tofile(qtemp/dspfd_out)')
c <> *blanks
c return syscallerr
c endif
c open qafdrfmt
c read qafdrfmt
c if %eof(qafdrfmt)
c return 'NODSPFD'
c endif
c close qafdrfmt
*** Do DSPOPT to an outfile to find the file requested. Loop
*** through all entries until a match is found.
c if syscall('dspopt vol(*mounted) ' +
c 'dev(opt01) data(*filatr) ' +
c 'path(''/'') output(*outfile)' +
c ' outfile(qtemp/dspopt_out)')
c <> *blanks
c return syscallerr
c endif
c if syscall('ovrdbf file(qamodfaf) ' +
c 'tofile(qtemp/dspopt_out)')
c <> *blanks
c return syscallerr
c endif
c eval found = *off
c open qamodfaf
c read qamodfaf
c dow not %eof(qamodfaf) and not found
c if %subst(offile : 2 : %len(cmpfile)) =
c cmpfile
c eval found = *on
c else
c read qamodfaf
c endif
c enddo
c close qamodfaf
c if not found
c return 'NotonCD'
c endif
*** Create a temp file in qtemp with record length matching
*** the physical file.
c if syscall('dltf qtemp/cdtemp' : 'CPF2105')
c <> *blanks
c return syscallerr
c endif
c if syscall('crtpf file(qtemp/cdtemp)'+
c ' rcdlen(' +
c %trim(%editc(rflen : 'Z')) +
c ') size(*nomax)')
c <> *blanks
c return syscallerr
c endif
*** Copy the CD file to the temp file.
c if syscall('cpyfrmstmf ' +
c 'fromstmf(''qopt/' + %trim(ofvid) +
c %trim(offile) + ''') ' +
c 'tombr(''qsys.lib/qtemp.lib/' +
c 'cdtemp.file/cdtemp.mbr'') ' +
c 'mbropt(*replace)')
c <> *blanks
c return syscallerr
c endif
*** Copy the temp file to the physical file.
c if syscall('cpyf qtemp/cdtemp ' +
c to_dbfile + ' mbropt(*replace) ' +
c 'fmtopt(*nochk)')
c <> *blanks
c return syscallerr
c endif
c return *blanks
p cpy_cd e
> -----Original Message-----
> From: Shelly.Sommerfeld@state.sd.us
> [mailto:Shelly.Sommerfeld@state.sd.us]
> Sent: Friday, October 12, 2001 7:54 AM
> To: midrange-l@midrange.com
> Subject: Retrieving Information
>
>
> I am trying to load some information off of a CD through a couple of
> programs. We are currently do this from a tape. We are
> upgrading to a 250
> model and would like to start using CD's. However I am
> having a little bit
> of trouble with copying the information from the CD to some
> files. I have
> tried most of the OPT commands and I guess that I am at my
> wits end with
> this and would like some help as to go about this. Thanks
>
> Shelly Sommerfeld
> Bureau of Information and Telecommunications
> Development Team 3
> (605) 773-5808
>
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.