IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Directory list from mainframe FTP


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vd120

New User


Joined: 06 Nov 2010
Posts: 24
Location: NYC

PostPosted: Wed Aug 03, 2011 10:24 pm
Reply with quote

Hello,

I need to get directory file list from the server I'm connecting to via FTP session. When I use Dir *.txt command I can see all the files in the folder on the screen, but when I try Dir *.txt > file_name.txt it is not working. Can you tell if this is possible? My task is to bring list of files from the folder to the mainframe for furser processing.

Thank you.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Aug 03, 2011 10:40 pm
Reply with quote

well, you have not told us much.

you do realize that file_name.txt will reside on the pc in whatever folder your ftp session set. you will need to transfer the file (get?) to the mainframe after creating it with your dir command. don't know if you can do it in the same ftp session, but probably.

there are others on the board who are more versed in ftp that I and can give you pointers if the want.
Back to top
View user's profile Send private message
vd120

New User


Joined: 06 Nov 2010
Posts: 24
Location: NYC

PostPosted: Wed Aug 03, 2011 10:48 pm
Reply with quote

Yes, I understand this and ready to get file (in the same step on next one). Problem to create file itself.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Aug 03, 2011 10:55 pm
Reply with quote

The syntax for the FTP DIR command is DIR followed optionally by directory/file name followed optionally by (DISK. Notice that you cannot use redirection such as you attempted.

Your best bet is to use DIR *.TXT (DISK and this will create a file named Use [URL] BBCode for External Links under your TSO user id; this file will contain the directory listing.

This is easily found in section 5.18 of the Communications Server: IP User's Guide and Commands manual, which is located on the IBM web site. Why did you not look it up for yourself?
Back to top
View user's profile Send private message
vd120

New User


Joined: 06 Nov 2010
Posts: 24
Location: NYC

PostPosted: Wed Aug 03, 2011 11:13 pm
Reply with quote

I looked in the different manual and did not find it. Thank you, look like it may work for me. Any chance do you know what would be high level qualifier for Use [URL] BBCode for External Links when jcl will be submitted by TWS scheduler?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Aug 04, 2011 12:55 am
Reply with quote

If there's a USER on the job card, then it'll be whatever that USER is. If not, it'll be whatever default user id is assigned by TWS -- and since we're not running TWS here, I have no idea what that would be. That may be a question for your site support group.

Personally, I'd put a USER on the job card to ensure I know where the directory listing goes!
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Thu Aug 04, 2011 9:03 pm
Reply with quote

Be careful with this too. The format of the directory list can change based on the server you are talking to. It can even change if the same server gets upgraded.

So make your directory parsing routine flexible and make sure it checks for valid data.
Back to top
View user's profile Send private message
vd120

New User


Joined: 06 Nov 2010
Posts: 24
Location: NYC

PostPosted: Thu Aug 04, 2011 9:07 pm
Reply with quote

Thank you.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Aug 05, 2011 5:23 am
Reply with quote

That's why I prefer LIST to DIR. Depends on what details you need, though.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Creating Unix Directory using COBOL i... COBOL Programming 2
No new posts Mainframe Programmer with CICS Skill... Mainframe Jobs 0
No new posts How to Reformat a file using File Man... All Other Mainframe Topics 14
Search our Forums:

Back to Top