FTP Get Issue

110 pts.
Tags:
AS 400
FTP
iSeries
Hi,
I have a Model 9406-170 with OS: V4R4M0
I can login to this system via FTP and navigate to the AS/400 library (MFG.PMS) that I want to download files from. I have verified through green screen that the files PMCR06.PGM and PMCR06CL.PGM exist in this library.
My FTP "pwd" command output:
257 "MFG.PMS" is current library
My FTP "ascii" command output:
200 Representation type is ASCII nonprint.
My FTP "get PMCR06.PGM" OR "get PMCR06" command output:
550 File PMCR06 in library MFG.PMS not found.
550 File PMCR06.PGM in library MFG.PMS not found.
So I attempted FTP command "dir" and get this output:
200 PORT subcommand request successful.
126 Member *ALL not found in file *ALL in library MFG.PMS.
250 List Completed.
NOTE: I ultimately want to do the following via FTP...
1) Start FTP session.
2) Set FTP session to ASCII.
3) Set FTP session to not prompt.
4) Navigate to an AS400 library.
5) Download all files in the library via FTP command mget *
Repeat starting at step 4.
I'm new to the AS/400 but not FTP. Anyone have any tips?
Thanks!
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Found this possible solution you can try

If you use MGET, then you are prompted for each member name, and can decide which ones to you want to download:
ftp <your-as400>
lcd c:\ftp
cd mylib
mget qclsrc
mget QCLSRC.DSPLIBL? n
mget QCLSRC.FTPCMD? y

Discuss This Question: 18  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • ToddN2000
    I don't think you can do the FTP as ASCII if they are located in a native i-Series library. I think it has to be BIN for binary. IF they are located,say in the IFS , you might be able to use ASCII.
    132,660 pointsBadges:
    report
  • smithmt052
    Thank you!

    I have received some guidance on this. I was looking for COBOL source code files to download. I was looking in a directory that had compiled programs.

    I'm currently searching for the source files - when I find them I will need to download them in batch to my PC for analysis.  

    Once I find these files does anyone know if I can just do an "mget *" command to download everything? I assumed I would need to set my session to ASCII in order to do the EBCIDIC to ASCII conversion.  

    Thanks in advance (totally new)

    110 pointsBadges:
    report
  • ToddN2000
    Another option if you still have issues

    1) Create a temporary OUTQ (NOT in QTEMP).

    2) Write a simple CL program to CPYSRCF for each member in
       the source file to *PRINT into the temp OUTQ. Loop through
       the members so you will then have an spool file for each source       member.

    3) Use Client Access Operations Navigator to look at
       the OUTQ and select all of the entries in the OUTQ.

    4) Copy and paste or drag/drop the selections to a folder in file 
       explorer and there you have it.
    132,660 pointsBadges:
    report
  • TheRealRaven
    PMCR06.PGM and PMCR06CL.PGM aren't files; they're (compiled) program objects. FTP can't read program objects.

    Locate the source files for those programs and point your FTP at those. Get the matching source members out of those files since the source code is what you actually want.
    35,060 pointsBadges:
    report
  • GregManzo
    Well, technically you could FTP the program object as a binary, but unless you are sending it to another IBMi system there is no way it will run the MI instruction set. There is also no point trying to convert the object code into ASCII because it isn't EBCDIC to start with, it's MI instructions. I assume you meant you were transferring the COBOL source.
    2,960 pointsBadges:
    report
  • TheRealRaven
    @GregManzo : I haven't seen a successful FTP of a compiled *PGM object, even as binary. File access methods used by FTP shouldn't be able to "read" *PGMs. On IBM i, "programs are not files".

    Do you have a sample script that shows it's possible? (Though I'm not sure I can think of any good use as long as alternatives exist.)
    35,060 pointsBadges:
    report
  • GregManzo
    Never actually seen it done. Can't even think why you'd want to. But in *theory* you could send /qsys.lib/mylib.lib/mypgm.pgm to another machine. 
    People still drive cars into trees - doesn't mean it's the best way to drive.
    2,960 pointsBadges:
    report
  • ToddN2000
    Another way I have moved source from one system to another is using a DDM file. I created a DDM file called DDMSOURCE and pointed it to the IP of the remote system. Then you can just do a CPYPFM for each member you want to move the source coed for.
    132,660 pointsBadges:
    report
  • smithmt052
    Hi all,

    I was looking to FTP down to my PC the COBOL source files which I need to locate.  I assume I can ASCII FTP them down.

    Was handed an AS/400 and have to provide support so I'm a little (a lot green).

    I'm back at looking for the source today.  As soon as I find it and I'm able to try downloading it I'll respond and update this string.

    Thanks
    110 pointsBadges:
    report
  • ToddN2000
    What is the purpose of copying the source code to a PC? If it just to view the code, why not just use the editor. If you plan on making changes to the code it is much easier to use the editor than to try and copy/paste any changes from a PC test file back into a source code member.
    132,660 pointsBadges:
    report
  • Splat
    Use a save file to transfer non-file objects, using binary mode.

    File objects can generally be transferred using ASCII mode.
    12,875 pointsBadges:
    report
  • smithmt052
    Regarding: "What is the purpose of copying the source code to a PC?" 

    I have literally been handed an AS/400 with ERP software on it (came from a software vendor that currently has a very small number of customers).  I'm looking to support them for now and see if the software is worth doing anything with. I have IT experience, very little 400 experience and no programmers available to me that developed this software.

    Just wanted to get all source down to a PC where I can look at it easily, organize it, do diffs, get a feel for what's going on.  I found CL, menu source and COBOL source last night but I find it difficult to work with one green screen in PDM to get a big picture overview.  I do have Client Access installed but its a really old version: Version 4 Release 4 Modification Level 0.  Also there is no service contract on the AS/400 so I have to find out how much a new version of Client Access would be.  Not sure what you are referring to when you say "why not just use the editor" ...is there a better tool (everything seems to be a bit far from a Visual Studio like development environment)?
    110 pointsBadges:
    report
  • GregManzo
    The Rational editor (running on your PC) will let you view/edit source directly from the IBMi source files. No need to download everything first.
    2,960 pointsBadges:
    report
  • smithmt052
    Thanks everyone! I'm going to go ahead with the Rational editor.
    110 pointsBadges:
    report
  • TheRealRaven
    @GregManzo : Referencing any *.PGM object with FTP should fail with QTCP/QTCPMSGF TCP12D7 "501 Unknown extension in database file name." AFAIK, basic system security should forbid reading *.PGM objects with file access methods.

    @smithmt052 : The Rational editor can be the best choice, but it's not always made available to developers by management. Various alternatives exist that are free.

    What is your server's OS version/release?
    35,060 pointsBadges:
    report
  • smithmt052
    My 400 is on V4R4M0.  I'm looking to get that upgraded ASAP but I need to make sure all this code will work with V6.1+ (I believe that is the version you can't move to until you are done checking observability).

    I have Rational downloaded now (trial version) and it doesn't seem to want to connect to my 400 - wondering if my OS version is the issue.  I will work through that.  

    I will search myself for free 400 COBOL IDEs but what ones do you recommend (free is better especially given my situation)?

    Thx!
    110 pointsBadges:
    report
  • WoodEngineer
    Regarding "I need to make sure all this code will work with V6.1+ (I believe that is the version you can't move to until you are done checking observability)."
    You are correct that observability is required which means the source code is required. 6.1 was a significant change to the AS/400 operating system. Programs had to be re-compiled to run.
    The utility will identify programs which cannot be converted, i.e. have no observability.
    It is worth pursuing Rational. Lots of features and nicely integrated with the AS/400.
    8,225 pointsBadges:
    report
  • smithmt052
    Thank you!
    110 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: