Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

transfer file from pc to as400, can' t use csv or txt

Status
Not open for further replies.

thelearner

Programmer
Jan 10, 2004
153
US
I want to transfer file from pc to as400. If I save under .PRN then I have to count position of the data. Every time I upload the data, I have to modify my program as to what position to move what field.
I can't use comma-delimited(.csv) because some of the data contain comma(,). Any suggestion???
 
Try first to create a new tranfer and in option create a new file and member based on the worksheet. I have had lot of stopping in the scanning before just because I had define char field and in excel it was numeric. Anyway by that macro you can rid off that.
 
It works now. My error was when I selected PC file type. I took the default, Excel8. After I changed to Excel 5.0/95 workbook, it worked.

How ever your code that I pasted in macro did not work.
I copy everything like this:


' ifNumeric convert to text
Sub num_totext()
For Each c In Worksheets("Sheet1").Range("A1:A100").Cells
If Application.IsNumber(c.Value) Then
c.Offset(0, 0).Value = "'" & c.Value
End If
Next c

End Sub
 
What error did you get? In Excel97 it should work anyway. It's kinda 'raw' macro. You have to ensure that your worksheet name in macro is the same as your worksheet name and also check the range.
 
oop! It was the range. I thought it said(A1:A1000).
One more question though. I have another file that all the columns contain numeric char. How do I modified that in your code.

Thanks a billion!!
 
Hi,
easiest way now would be that you define range in your worksheet. Insert/name/define. Then in macro replace:
For Each c In Worksheets("YourSheet").Range("YourRange").Cells
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top