File FTP to Unix from Mainframes.


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users File FTP to Unix from Mainframes.
# 1  
Old 08-02-2007
File FTP to Unix from Mainframes.

Hi I have got one file FTPd from mainframe in an ASCII format in Unix environment.

If I have to deduce record width within this file, each approach we are finding different record width.

head -1 filename | wc -m
awk '{print length($0)}' filename ... lists record width for all records.
sed -n '1np' filename | wc -m

Each of these 3 approaches I get different count. It is very much clear file which got transferred from Mainframes is not correctly got FTPd.

Has anyone faced this problem before, & can help me?

Thanks in advance.
# 2  
Old 08-02-2007
Just a thought, when the data comes over from a mainframe, won't it be in EBCDIC encoding? You will probably have to convert this to ASCII before you can do anything with it.
# 3  
Old 08-02-2007
If you do a search of all forums for "ftp mainframe" you should find several threads about transferring fixed record length files.
# 4  
Old 08-03-2007
My team is receiving file from mainframes, for which we are not writing FTP command in a JCL.
My question is how come 3 different commands which help in estimating no of chars in record give different output?
Since any normal ASCII file, the command I mentioned produces the same counts.

The file which we receive is in ASCII, because when I cat it, I can see the ASCII business contents in it.
# 5  
Old 08-03-2007
You don't provide much info, but I will make a guess based the little info I have. Those files are not organized as a collection of lines of ascii characters. A line will have a max length and it must be terminated by a newline character. Files like this are the only files those commands are designed to work with. So each command is screwing up in a slightly different manner.
# 6  
Old 08-07-2007
Yes you are right Perderabo, the file which we received from mainframes had these weird '^@' chars, which is not detectible by simple cat command. It could be only seen by cat -v.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Connect Direct for copying files from Mainframes to UNIX

Hai Friends, Please help me in providing unix shell script for pulling data from mainframe dataset to unix using connect direct (NDM). Thanks in advance (1 Reply)
Discussion started by: karthikm
1 Replies

2. Shell Programming and Scripting

UNIX script to FTP file from UNIX server to windows

Hi, I am new to this subject.....Can someone please help me out with the script... unix usernm "sdhftst" unix pwd "chsd13" windows usernm "dfghtst" windows pwd "chsd13" path..../xxx/xxxxx/xxxxxx/xxxxxxx please can u get me a script...its only one file to get ftp. Thanks... (2 Replies)
Discussion started by: himakiran9
2 Replies

3. UNIX for Dummies Questions & Answers

FTP to Mainframes from Unix

Hi, Iam new to unix.I have 3 files to be FTPied to Mainframe from Unix(Sun Solaries Unix). Sample record in one file is as shown below. 123ßRajß123-456ßjackßß 124ßRajeshß123-457ßjacmßß In the above file the records are seperated by delimitter "ß". When I used the below script to FTP from Unix... (3 Replies)
Discussion started by: Rahul321
3 Replies

4. UNIX for Dummies Questions & Answers

Problem in FTP from Unix to Mainframes

Hi, I have one file to FTP from Unix to mainframe. It has been successfully FTPied. But problem is my Unix file will be generated as file_name1.sh. But Mainframes side they need file in file.name1.sh. So they dont need underscore (_) in the file name. Please let me know if there is any solution... (1 Reply)
Discussion started by: manneni prakash
1 Replies

5. Shell Programming and Scripting

How to FTP file usinf shell script to Mainframes

Hi , Please help me FTP an output file to mainframes using Mainframes. I have no idea how to FTP to mainframes. :( I need to deploy my code by next week. The code is ready but the client's requirement is that i need to ftp all the output file to the mainframes server. I created the dataset... (1 Reply)
Discussion started by: deepthimathew
1 Replies

6. Shell Programming and Scripting

FTP script to FTP file to UNIX - Solaris

Hello, A couple of times per week, i receive emails notifications when files are available for processing. Currently i read these eamails with a java program and store the attachement on my C: drive and would now like to generate a PC script to send this file name up to UNIX-Solaris and... (3 Replies)
Discussion started by: bobk544
3 Replies

7. Shell Programming and Scripting

FTP script for sending a file from one unix directory to another unix server director

Hi, My local server is :/usr/abcd/ Remote server is :/Usr/host/test/ I want to send files from local unix directory(All files starting with O_999) to remote host unix directory. Can any body give me the Unix Shell script to do this. One more doubt: Shall we need to change the file... (1 Reply)
Discussion started by: raja_1234
1 Replies

8. UNIX for Dummies Questions & Answers

FTP file to Mainframes

Hi, Can somebody please share a sample Korn shell script that will FTP a file from an Unix box to a region in Mainframe.It will be of great help if i can get this script ASAP.Or atleast give me a hint on how to do it. Thanks, Gopi (1 Reply)
Discussion started by: bhgopi
1 Replies
Login or Register to Ask a Question