Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Input Command with Mainframe file and multiple variables

Hi,

I am having trouble with the Input command.

My code looks like this:

Open "I:/Excel Experiments/WIOTAN1.csv" _
For Input As #2

Input #2, iAnalystCode, iAnalystName


Because my input file comes from the mainframe and is IEBGENER'd
(copied) to a USS platform (Unix-ish) it has carraige control
characters after the second field. But when I read the file, it is
not seeing the carraige control as the end of the line.

How can I get the Input command to recognize the carriage return as the
end of the line?

Or am I forced to use the "Line Input" and parsing out my fields? (say
it ain't so)

Thanks,
B


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Input Command with Mainframe file and multiple variables

Could you use a get statement until <cr and re-build the line comming in
with
concatination?
-Tim
"BSchwerdt" wrote in message
...
Hi,

I am having trouble with the Input command.

My code looks like this:

Open "I:/Excel Experiments/WIOTAN1.csv" _
For Input As #2

Input #2, iAnalystCode, iAnalystName


Because my input file comes from the mainframe and is IEBGENER'd
(copied) to a USS platform (Unix-ish) it has carraige control
characters after the second field. But when I read the file, it is
not seeing the carraige control as the end of the line.

How can I get the Input command to recognize the carriage return as the
end of the line?

Or am I forced to use the "Line Input" and parsing out my fields? (say
it ain't so)

Thanks,
B


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Input Command with Mainframe file and multiple variables

Try reading the whole file into a variable, then use the split command with
the control character as a separator to break your data into elements of an
array.

This requires VBA 6 (xl2000 or later).

http://support.microsoft.com/support...eio/fileio.asp
File Access with Visual Basic® for Applications


--
Regards,
Tom Ogilvy



BSchwerdt wrote in message
...
Hi,

I am having trouble with the Input command.

My code looks like this:

Open "I:/Excel Experiments/WIOTAN1.csv" _
For Input As #2

Input #2, iAnalystCode, iAnalystName


Because my input file comes from the mainframe and is IEBGENER'd
(copied) to a USS platform (Unix-ish) it has carraige control
characters after the second field. But when I read the file, it is
not seeing the carraige control as the end of the line.

How can I get the Input command to recognize the carriage return as the
end of the line?

Or am I forced to use the "Line Input" and parsing out my fields? (say
it ain't so)

Thanks,
B


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Input Command with Mainframe file and multiple variables

Thanks for the ideas.

As it turns out the solution we will be using is to "fake out" Excel/VB
by forcing an EBCDIC hex character of X"0D" in the last character of
each record. We can do this on the mainframe so when the file is
copied to the Unix platform, it will recognize that character as the
end of record.

Thanks again,
B


---
Message posted from http://www.ExcelForum.com/

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Input Command with Mainframe file and multiple variables

There are tons of free versions of Unix2Dos conversion programs out there (check
www.shareware.com and you'll see lots).

I have a couple of programs that use VBA's Shell command to run one of these
programs and then do the import.

Alternatively, you could shell to DOS manually, convert the file and then have
your macro run.

If you like that idea, here's a link to a previous thread that gives more
detail:
http://groups.google.com/groups?thre...BBD7%40msn.com

BSchwerdt wrote:

Thanks for the ideas.

As it turns out the solution we will be using is to "fake out" Excel/VB
by forcing an EBCDIC hex character of X"0D" in the last character of
each record. We can do this on the mainframe so when the file is
copied to the Unix platform, it will recognize that character as the
end of record.

Thanks again,
B

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mainframe File to Excel Spreadsheet Dave Cox Excel Discussion (Misc queries) 2 August 6th 08 04:59 PM
mainframe file to excel spreadsheet Dave Cox Excel Worksheet Functions 5 April 26th 07 01:01 PM
How to transfer a mainframe file to excel sesh Links and Linking in Excel 4 May 2nd 05 08:19 PM
How to transfer a mainframe file to excel sesh Excel Discussion (Misc queries) 1 April 21st 05 01:18 PM
Need to save file for mainframe Rick Excel Discussion (Misc queries) 2 February 15th 05 10:49 PM


All times are GMT +1. The time now is 08:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"