Solved

FTP from PC to get VB dataset

Posted on 2011-02-16
8
453 Views
Last Modified: 2014-04-30
I need to download a variable block dataset from the mainframe to my windows PC. I need to download the VB dataset as a text file with each record in a separate line and with the trailing blanks/spaces intact. For example, if the VB dataset has a LRECL of 1008 bytes, I need the downloaded file to have record #1 on t he first line with 1008 bytes, record #2 on the second line with 1008 bytes and so on. For simplicity, lets assume that there are ten records in the VB dataset. Please give me the FTP commands to download the VB dataset maintaining the LRECL as defined(1008 in our case). I'm connecting from a windows PC on the command line to a mainframe computer. I'm new to both FTP and mainframe computers. Thanks.

Example:

VB dataset on Mainframe:  LRECL=1008 and RECFM=VB

RECORD1: ABCDXXXXXXXXXXXXXXXXXXXX BLANKS/SPACES
RECORD2: ATRCDEXXXXXXXXXXXX BLANKS/SPACES

I want the downloaded file to be an exact replica of the dataset with each record on its own line. Thanks.
0
Comment
Question by:marknewprog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
8 Comments
 
LVL 16

Expert Comment

by:AlexPace
ID: 34913432
One problem that happens pulling a text file from an IBM FTP server is that some of them use the EBCDIC character set instead of ASCII.  If this happens the data you downloaded will appear to be corrupt.  Sometimes you get an "almost perfect" translation but there will be a problem with control characters like Line Feed, Tab, or Carriage Return.  Sometimes everything looks good except the "~" tilde character.

Here is an easy way to test.  Download and install the eval version of Robo-FTP client (it supports EBCDIC translation.)  Open the main console window and do this:  (except with your server's address and your real username and password)
FTPLOGON "127.0.0.1" /user="myuserid" /pw="mypassword" /ibm
RCVFILE "FileName" /as "FileName_B" /type="ASCII"
RCVFILE "FileName" /as "FileName_A" /type="BIN"
RCVFILE "FileName" /as "FileName_E" /type="EBCDIC"
FTPLOGOFF

Open in new window

So you are downloading the same file 3 different times using  ASCII, BIN, and EBCDIC modes.  

Actually on those RCVFILE lines you want to change where it says "FileName" to your actual file name except in the part after the /as so each download version gets a different name so you can tell them apart.  

Anyway, now all you have to do is open those 3 versions of the same file and see which one is in the proper format
0
 
LVL 2

Expert Comment

by:mkc451
ID: 34916819
I have a couple of questions -- you say Mainframe, do you mean AS400 or 390 Series Mainframe. It does make a difference. But since this is in the AS400 queue here I will assume 400.

Why FTP?? Why not use VB to access the 400 directly and pull the data into your set. You can get to it via SQL with ODBC,ADO or directly. It's much much simpler than downloading the data. What version of VB are you using - .NET? There are specific drivers in iSeries Access to use that will allow you to access data directly. Another option would be to use the built in data transfer routine in iSeries access to download to a CSV or Text FIle, or even directly to an Excel file format.  In addition you can use Access to Link a database and access it that way, or you can use Excel and Microsoft Query/ODBC to access it. I have done all of these numerous times.

http://lmgtfy.com/?q=VBA+access+to+IBM+AS+400+Data

Hit this link and let it run. you will find numerous articles about access 400 data via VB ... that would seem a much better way to accomplish what you want to do.

Mike Cody
0
 
LVL 16

Expert Comment

by:AlexPace
ID: 34916898
I think when he wrote VB he was talking about the records stored in Variable Block format on the server instead of Visual Basic.  Please clarify.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:mkc451
ID: 34917051
I see that now, shows I spend to much time with Visual Basic ... However he should still be able to use numerous tools to access the data, FTP would most likely be my last choice to xfer data like this.. Extracting it via a program would seem best.
0
 
LVL 57

Expert Comment

by:giltjr
ID: 34922898
I will have to do some testing, but I'm not sure you can do that.

What you can try is after you logon to the FTP server issue the command:

     quote site trailingblanks

This tells the mainframe to leave the trailing blanks on the end of the record, but I'm not sure if it will fill out variable records to the full possible length with blanks.
0
 
LVL 57

Accepted Solution

by:
giltjr earned 250 total points
ID: 34922927
Just tested and the quote site trailingblanks will pad to the end of the full possible record length, 1008 bytes in your case.
0
 
LVL 14

Expert Comment

by:daveslater
ID: 40031498
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction How to create multiboot configuration with XP\Vista and Windows 7 on it? And most important question - how to do this correctly so not to have any kind of nightmares we get when system gets screwed? First of all one should realize t…
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question