Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Help with CPYTOIMPF command

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with CPYTOIMPF command

    Neal - Suggestion #1 - don't use QDLS (you aren't still using Windows 3.1, are you? Join us in the new millenium!! :-) ), use the 'root' file system - you'll get better performance. (Look at the WRKLNK command.) Suggestion #2 - set the STMFCODPAG parm to *PCASCII to get a code page that your PC can view. Suggestion #3 - MBROPT(*ADD) is equivalent to MBROPT(*ADD) on the CPYF command - it will *ADD records to any existing records in the file (I.E., if you run the same command twice, you will have 2 sets of identical records in the same file). Use *REPLACE if you want to 'refresh' the file. HTH, Steve

  • #2
    Help with CPYTOIMPF command

    Thanks for the reply Steve First off, we're not really that far from Windows 3.1 - we're still on NT4! I'm definitely interested in knowing the best way to go about this - would you have any links to point me to in terms of getting set up? I had a look in the InfoCentre about WRKLNK, but I can't actually run the command on our machine - no authority! Could be because it's just never been used and I have to ask our Security Officer to grant me it? Suggestions 2 and 3 taken on board for the next time I try it, thanks

    Comment


    • #3
      Help with CPYTOIMPF command

      Ok another couple of questions for you Steve - if you have a minute! I got granted the WRKLNK command, and have set up a directory /home/mylib Now there were 3 directories in /home already - lib1, lib2 and lib3 When I try to "Map Network Drive" in Windows NT for and go to \iserieslib1 I can view it. This does not work for the other 2 libraries, or my new one. I've altered my CPYTOIMPF command to be: CPYTOIMPF FROMFILE(MYLIB/MYFILE) TOSTMF('/home/lib1/myfile.csv') MBRO PT(*REPLACE) STMFCODPAG(*PCASCII) RCDDLM(*CRLF) This copies in the file, which I can see in Windows explorer through my mapped network drive, but when I try to open the file I get the same error as before. There's obviously a lot I'm not really getting with this....

      Comment


      • #4
        Help with CPYTOIMPF command

        Neal - Were the 3 libraries in /home *literally* named "lib1", "lib2", and "lib3"? Or did you just choose those names for clarity in your message? IFS security is somewhat different than OS/400 object security. If you enter "WRKLNK '/home' " and place a '9' by the link for the 'home' directory, you will see the authorities for the 'home' directory. Likewise, if you enter a '5' by the link for 'home', you will see the contents of the 'home' directory and can use '9' to review the authorities of those directory entries. Insure that your user profile has RWX authority from the 'root' directory all the way through to the particular IFS file that you wish to view. If you don't have RWX, you can change authorities with option '9'. This will display the 'Work with Authority' screen. If you need to change the owner of the file for some reason, you can press 'F19' from this screen to do so. It may be that 'lib2', 'lib3', and your new library are not 'shared' through Netserver. Open iSeries Navigator (Operations Navigator), expand your system info in the left column, then expand 'File Systems' and right-click on 'File Shares' to open Netserver and review existing shares. You may need to create new shares. If you CPYTOIMPF to a file that was created previously with a different code page, the file will retain that code page even though you specify PCASCII. Be sure that you are creating a new file in order to get the expected code page. HTH, Steve "nealhudson" wrote in message news:6b39ffd1.2@WebX.WawyahGHajS... > Ok another couple of questions for you Steve - if you have a minute! > > I got granted the WRKLNK command, and have set up a directory /home/mylib > > Now there were 3 directories in /home already - lib1, lib2 and lib3 > > When I try to "Map Network Drive" in Windows NT for and go to > \iserieslib1 I can view it. This does not work for the other 2 > libraries, or my new one. > > I've altered my CPYTOIMPF command to be: > CPYTOIMPF FROMFILE(MYLIB/MYFILE) TOSTMF('/home/lib1/myfile.csv') MBRO > PT(*REPLACE) STMFCODPAG(*PCASCII) RCDDLM(*CRLF) > > This copies in the file, which I can see in Windows explorer through my > mapped network drive, but when I try to open the file I get the same error > as before. There's obviously a lot I'm not really getting with this....

        Comment


        • #5
          Help with CPYTOIMPF command

          Hi, I'm still having problems here, unable to open the file from Window's Explorer (NT4). I'll describe the steps undertaken thus far: Created a directory in /home called hudsonn Shared this out in Operations Navigatory (well got Security Officer to do it), and can now Map the Network Drive in WinNT Ran the command: CPYTOIMPF FROMFILE(MCLSYD/MCXB9R) TOSTMF('/home/hudsonn/mcxb9r.csv') MBROPT(*REPLACE) STMFCODPAG(*PCASCII) RCDDLM(*CRLF) The file was created in the folder and I can see it in Window's Explorer, but when I try to open it I still get the error message. Another thing was that the CPYTOIMPF command took 58 minutes to run!! There's about 180,000 records in the file, but when I use Client Access to download the file as a CSV, it only takes about 10 minutes.

          Comment


          • #6
            Help with CPYTOIMPF command

            Neal - Can you use the green screen command EDTF '/home/hudsonn' then option 5 to view the file? Does it look OK? Are you still trying to use NotePad to open? NotePad cannot open "very large" files. Try WordPad or go to a DOS prompt, change to the mapped drive and proper directory and do a "type yourfilename" or attempt to open the file using your favorite all-purpose piece of software. We're trying to determine if you can't open the file because it's too big or because there is something wrong with the file. Steve "nealhudson" wrote in message news:6b39ffd1.4@WebX.WawyahGHajS... > Hi, > > I'm still having problems here, unable to open the file from Window's > Explorer (NT4). > > I'll describe the steps undertaken thus far: > > Created a directory in /home called hudsonn > > Shared this out in Operations Navigatory (well got Security Officer to do > it), and can now Map the Network Drive in WinNT > > Ran the command: > CPYTOIMPF FROMFILE(MCLSYD/MCXB9R) TOSTMF('/home/hudsonn/mcxb9r.csv') > MBROPT(*REPLACE) STMFCODPAG(*PCASCII) RCDDLM(*CRLF) > > The file was created in the folder and I can see it in Window's Explorer, > but when I try to open it I still get the error message. > > Another thing was that the CPYTOIMPF command took 58 minutes to run!! > There's about 180,000 records in the file, but when I use Client Access to > download the file as a CSV, it only takes about 10 minutes.

            Comment


            • #7
              Help with CPYTOIMPF command

              Thanks for your input Steve. At the moment I can't use the EDTF command - not authorised, hopefully get the Security Officer to allow me into it shortly. Yea I've tried Notepad, Wordpad, Excel, can't open the file. I've actually streamed 2 CSV files, the one with 180,000 records, the other with just 300, so I don't think it's the file size issue. The message in Excel says "Cannot open read-only document 'exrsla.csv'", Thanks again

              Comment


              • #8
                Help with CPYTOIMPF command

                Neal - Navigate to your file using WRKLNK and use option 9 to give yourself *RWX authority. If you already have *RWX on your file, work backwards down the directory path and be sure that you have *RWX to all the sub-directories in the directory path. HTH, Steve "nealhudson" wrote in message news:6b39ffd1.6@WebX.WawyahGHajS... > Thanks for your input Steve. > > At the moment I can't use the EDTF command - not authorised, hopefully get > the Security Officer to allow me into it shortly. > > Yea I've tried Notepad, Wordpad, Excel, can't open the file. I've actually > streamed 2 CSV files, the one with 180,000 records, the other with just > 300, so I don't think it's the file size issue. > > The message in Excel says "Cannot open read-only document 'exrsla.csv'", > Thanks again

                Comment


                • #9
                  Help with CPYTOIMPF command

                  Your advice pointed me in the right direction. Even though there was *PUBLIC *RWX access on the /home and /home/hudsonn folders, the streamed files themselves have been created with: Data --Object Authorities-- User Authority Exist Mgt Alter Ref[*]PUBLIC *NONE X X X X HUDSONN *RWX X X X X When I was Mapping the Network drive this morning, I used a different UserId than HUDSONN, so once I disconnected the drive and reconnected it as myself I can now see the files. Thanks again for your help!

                  Comment


                  • #10
                    Help with CPYTOIMPF command

                    Hi I'm trying to use this command to get a file from a library on the iSeries, to a network folder, in a CSV format. Here is the options I'm using: CPYTOIMPF FROMFILE(MYLIB/MYFILE) TOSTMF('/qdls/myfolder/csvfile.csv') MBROPT(*ADD) STMFCODPAG(*STMF) RCDDLM(*CRLF) DTAFMT(*DLM) When this runs I get the message: All records copied from file MYFILE in MYLIB When I go to the drive \iseriesqdlsmyfolder the file csvfile.csv has been created, but when I try to open the file I get the error in Notepad in Windows: "Cannot open the file F:..... Make sure a disk is in the drive you specified" I've never used the CPYTOIMPF command before so am looking for a little help with this, thanks

                    Comment


                    • #11
                      Help with CPYTOIMPF command

                      I'm also tring to use the CPYTOIMPF command. I kept getting no records copied. The looks like this ===> CPYTOIMPF FROMFILE(BPCSUSRF/EDIWALASN) TOSTMF('/data/test') STMFCODPAG(*PCASCII) RCDDLM(*CRLF) DTAFMT(*fixed). Have any idea what I'm doing wrong.

                      Comment

                      Working...
                      X