× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Title: RE: CPYTOIMPF question
Guy,
 
Thanks for the input.  I tried the stream file command, but that it limited to a 3 field file or a flat file (for source files).  Pretty silly, but the rules.  The IMPF command fails on an SQL error using a work file in qtemp.  I was wondering if you have ever seen theis before in your attempts.  The command looks like:
 
   CPYTOIMPF  FROMFILE(TAMMY/SOP015L SOP015L) +          
  TOSTMF('\QDLDS\LABELS\L' +                             
      *CAT &ON *CAT '.CSV') MBROPT(*REPLACE) RCDDLM(*CRLF)
 
The error is:
After running the command
 Ownership of object QACEXFLD12 in QTEMP type *USRSPC changed.   
 QCP_TAMMYSOP015LSOP015L in TAMMY type *FILE not found.          
 Error Occurred in SQL Call Level Interface                      
 Ownership of object QCP_T00001 in TAMMY type *FILE changed.     
 Ownership of object QCP_T00001 in TAMMY type *FILE changed.     
 File could not be created.                                      
 No records copied from file SOP015L in TAMMY.                   
 Object QACP301705 in QTEMP type *FILE deleted.                  
 Copy command ended because of error.        
 
Any ideas woulr be greatly appreciated.  Also, if the *TAB does not work, does *CRLF??
 
Thanks
 
john
                    
 
From: Murphy, Guy [mailto:murphy@uif.uillinois.edu]
Sent: Wednesday, May 12, 1999 1:24 PM
To: 'MIDRANGE-L@midrange.com'
Subject: RE: CPYTOIMPF question

        I've been working with this command lately. Maybe I can help.  The first to know is that although the CPYTOIMPF will create a stream file, the stream file will have the same code page as the database file and so the contents will be EBCDIC.  If the stream file already exists and has a PC ASCII code page, the CPYTOIMPF will convert the EBCDIC to ASCII and convert pack decimals to ASCII numbers.  You can create this stream file with your PC using Client Access or some other utility.

        You can also create the stream file with the correct code page on the 400 with the CPYTOSTMF command by setting the command parm STMFCODPAG to *PCASCII.  Use the CPYTOSTMF command to copy a source physical file to a stream file like this:

        CPYTOSTMF FROMMBR('/qsys.lib/qgpl.lib/qclsrc.file/member.mbr')
        TOSTMF('/qdls/yourflr/yourfil.txt') STMFCODPAG(*PCASCII)

        The file names have to be in IFS format.  CPYTOSTMF will work with program described files and externally defined files with no more that three fields, but I find that source files work best.  Use any source file you want, since its contents will overridden by the CPYTOIMPF command.

        These 2 examples of the CPYTOIMPF command has worked for me:

        CPYTOIMPF FROMFILE(YOURLIB/YOURFILE YOURMEMBER) TOSTMF('/qdls/yourflr/yourfil.txt')
        MBROPT(*REPLACE) RCDDLM(*CRLF) DTAFMT(*FIXED)
or
        CPYTOIMPF FROMFILE(YOURLIB/YOURFILE YOURMEMBER) TOSTMF('/qdls/yourflr/yourfil.txt')
        MBROPT(*REPLACE) RCDDLM(*CRLF) DTAFMT(*DLM) STRDLM('"') FLDDLM(X'05')

        The X'05' in the second example creates a TAB delimited file.  On the command prompt the FLDDLM parameter is only 3 characters long.  Use the ampersand (&) to expand the field so you can enter the hexidecimal X'05'.  There is a *TAB value for this parameter but it doesn't work.  Maybe there is a PTF for it somewhere.

        I hope this helps.

Guy Murphy - FACTS system
University of Illinois
217-333-8670



-----Original Message-----
From: John Bussert [mailto:jbussert@stecnet.com]
Sent: Wednesday, May 12, 1999 9:36 AM
To: MIDRANGE-L (E-mail)
Subject: CPYTOIMPF question


When using the copy to import file command, the to stream file, how is that
formatted and where does it exist.  I am trying to copy a file to a folder,
but it fails on the creation of the to file becuase ??? (of course the
message does not tell me why).

Has anyone used this or the CPYTOSTMF command that has the same to parm??

Thanks

Just as an aside - does anyone like the book manager?? It is the worst peice
of software I have ever seen - give me printed manuals.......  Where is the
CL programmers reference manual??? Sorry for the rant ;-)

john

John Bussert
jbussert@stecnet.com
Swift Technologies, Inc.
847-289-8339
847-289-8939 fax

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.