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!

How to redirect the file from UNIX to Mainframe !!!

Status
Not open for further replies.

dearjay

Programmer
Dec 19, 2007
35
IN
Dear All,

Please let me know the UNIX command to redirect the output of the LIST command into output file.

Thanks,
Nits
 
You're going to need to be much more specific. For starters, what's the LIST command? What is it a command to? What do you use to issue it? Are you talking about FTP?

After reading your previous threads on this topic, I'd suggest explaining your problem as though we have no background information on it. Because we don't.
 
Dear Clipper, sorry for the inconvenience. here u go

Dear All,

I am trying to get the list of the dataset names from the Remote server to local server. I want to copy the list of files into dataset at local server. Can somebody help me to get this done please?

===============================
IP ADDRESS
USER ID
PASSWORD
REMOTE HOST NAME
LS <name> <(DISK> - Command format (for example)
LS * Disk name
===============================

I am trying with the above command, but getting
Std Return Code = 20000, Error Code = 00007
Please let me know in case if you have any idea about the same.
Thanks,
Nits
 
FWIW. With SCO Open Server on both machines it would be:

original logon as root
rlogin to foreign server as root
cd to the directory you wiah to work with
ls > files
rcp foreignserver:/path/files localserver:/path/filename
exit

This is one method.

Another would be to log to the foreign and create the file, then exit out and get the file via ftp.




Ed Fair
Give the wrong symptoms, get the wrong solutions.
 
Dear Ed,
how to create the file on foreign, i tried to create the file on foreign with ls > file1 command (in the same directory where i am referring the files for listing... but i was not able to create the file at remote server.

Please suggest,
Regards,
Nits
 
Dear Ed,

Kindly provide me the command sample for the second option.

Regards,
Nits
 
Dear All,

To copy the output of the LIST command into new file (at remote server, i tried this,

===============================
IP ADDRESS
USER ID
PASSWORD
CD /Data/EXTERN
LS > file1
QUIT
===============================

Here, My aim is get the list of remote server (UNIX) file names from the EXTERN directory. There are total 3 files in EXTERN directory, so i should get total no. of files = 3 in file1. This file1 should get created in the same EXTERN directory. If the file1 would have been successfully created with the list of files, then i would have done FTP for file1 for the further process.

Thats what i have tried to execute from the Mainframe, but didn't get the expected result.

Please correct me where i went wrong.

Awaiting for u r suggestion.

Regards,
Nits
 
There is an issue there because you will also get the file1 listed in the list.

Probably better to see what other directories are available for temporary storage, possibly /tmp

If you are logged in on the foreign machine it would be

ls /path > /tmp/file1

then rcp or ftp.

and as a test, once you do the ls, cat /tmp/file1 to see that it did what you expected.

Ed Fair
Give the wrong symptoms, get the wrong solutions.
 
Dear Ed,
What is mean by rcp? what it does exactly.. i will test this senario and let you know the result for reference.

Regards,
Nits
 
Dear Ed,

I tried the below command to get the list of files into one dataset.

===============================
IP ADDRESS
USER ID
PASSWORD
CD /Data/EXTERN
DIR /EXTERN
LS * file1
QUIT
===============================
As per my understanding, file1 should have the list of files
which files are available in EXTERN directory. file1 should be created in EXTERN. If this is correct, then also i am not getting the expected result.
Please suggest,
Regards,
Nits
 
Also let me know, in case of following...

DATA directory has two folders.

1. INTERN
2. EXTERN

As i want to get the list of files from EXTERN and create the file file1. How can i save the file1 into INTERN?

Please suggest,

Regards,
Nits
 
I don't know what operating systems you are using so what I propose using may not work with your systems.

rcp is remote copy. It allows you to copy files from one machine to another. And it may very well be SCO only by that name. But any modern unix should have something available to do the same thing. You may be able to mount the remote drive so it appears to be on your machine. Then you could copy the files from the mounted drive to a local drive.

ls > file1 should put the contents of the directory into the file.

cat file1 should list the contents of the file.

Do you have manuals for the operating systems you are dealing with?


Ed Fair
Give the wrong symptoms, get the wrong solutions.
 
Dear Ed,

Thank you very much for your input. I really appreciate that. Unfortunately i don't have any manucal with me.
But please let me know what i need to know about it, so that i can ask UNIX support people and will get back to you.

i am trying this command

ls > file1.

but file1 is not getting created, i believe this the simple UNIX command, then why it is not giving the result?

Please suggest,

Regards,
Nits
 
What happens with "ls" ? Should be a display of the files on the directory where you are.

What happens with "l" ? Should also display files.

Where are you in the file system? Try "pwd". It should show you.

How are you logged on to the system? try "who am i" to see who the system thinks you are.

If you "cd .." it should take you up a level in the file system, then "l directoryname" should show the directory you were wanting to see and should show permissions to use the directory. If you don't have permission to write in it you can't create the file.

Ed Fair
Give the wrong symptoms, get the wrong solutions.
 
Dear Ed,

Thank you so much for your information. I will try this and will let you know in case if there is any problem.

I was able to rename the file in the same directory, so i think it os as good as creating the new file... but may be i will cross check again.

Regards,
Nits
 
Dear All,

I think FTPS doesn't support ls > file1 command. Can you please let me know any other altertaive?

Regards,
Nits
 
What about this ?
man ftps

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top