Solved

FTP from PC to get VB dataset

Posted on 2011-02-16
8
428 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
  • 2
  • 2
  • 2
  • +1
8 Comments
 
LVL 16

Expert Comment

by:AlexPace
Comment Utility
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
Comment Utility
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
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 2

Expert Comment

by:mkc451
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now