Script for FTPing files to mainframe GDG


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Script for FTPing files to mainframe GDG
# 1  
Old 03-12-2008
Script for FTPing files to mainframe GDG

Hi,

Request Unix gurus to kindly share a script which FTPs multiple files from Unix to a Mainframe GDG.

The script should check for oldest file named as 'abc*.txt' in a directory '/dir/child'. FTP that file to MF, then remove the file from unix and then look for the next oldest file to be sent.

Dont know abt syntax and logic but this is what I want

while (ls -tr abc* | head -1)
{
FILENAME = $(ls -tr /dir/child/abc*.txt | head -1)
#more commands to send the file through FTP to Mainframe
rm /dir/child/$FILENAME
}

thanks
DSR
# 2  
Old 03-13-2008
Hi,
I am not sure if it is possible to create gdgs from unix. We run jobs on the Mainframe side that get files from a ftp server and load them into a GDG, but that is one file at a time and the name is fixed. I have read where you can create JCL on Unix, place it in a file and then "submit" or transfer it to the Mainframe to be ran. You of course would have to have security on the Mainframe side to do this. Here are a couple of links that might be of interest.
z/Journal - The Resource for Users of IBM Mainframe Systems

Using FTP to Access MVS and Unix - NIU - Information Technology Services
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Mainframe SAS JCL to Korn Shell script conversion

Hi All, Please help me to the conversion of Mainframe SAS JCL to korn Unix script. Please share the example from SAS JCL to Korn Unix Script. It be really helpful. Please share the online source also so I can look into it. Thanks, Abhishek (5 Replies)
Discussion started by: Abhishek Tyagi
5 Replies

2. Shell Programming and Scripting

shell script returning error code 2 from AIX to Mainframe

Hi, I have a shell script which is residing on AIX which is triggered by Mainframe through Connect Direct. The shell script creates several files and sends those files to mainframe using Connect Direct. The shell script is working fine, still it is returning exit code 2 to mainframe. What... (0 Replies)
Discussion started by: Yogesh Aggarwal
0 Replies

3. UNIX for Advanced & Expert Users

Use of GDG files in UNIX using MBM (Mainframe Batch Manager).

Use of GDG files in UNIX using MBM (Mainframe Batch Manager). Is any one working with GDG files in UNIX (AIX) using the MBM wrapper? I need some help to refer the GDG files in the scripts. (0 Replies)
Discussion started by: deeceeds
0 Replies

4. Shell Programming and Scripting

FTPing files from unix server to windows server

Hi, Below is the script which ftps the file from unix server and putting in a different directory(but on unix server) How can i ftp the files from unix server and to place in a secure location on windows server? what changes needs to be done to the below script? How can this be... (1 Reply)
Discussion started by: venkatesht
1 Replies

5. Shell Programming and Scripting

FTP files to target Mainframe system

Hi Experts... Greetings for the day..! I just want to FTP the files to mainframe system.. my code is not working..and also i need to put the files in a particular directory in a specific naming format... ftp -i -n ${HOST_NAME} << END_FTP user ${USER_NAME} ${PASSWORD} put ${FILE_NAME}... (3 Replies)
Discussion started by: spkandy
3 Replies

6. Shell Programming and Scripting

removing files after ftping

Hi All, I'm trying to write script to ftp some files and then need to remove these files from server. Is there any way to keep the condition that the file should be removed only after successfully transfered to the destinatino server? If in case, the file isn't been transferd, it should not be... (5 Replies)
Discussion started by: im_new
5 Replies

7. Shell Programming and Scripting

Error in ftping script

Hi all , Can u please help me in this. I tried to just login server through the below script SERVER="Server_NAME" USER="i am user" PASSWD="mypassword" ftp -in $SERVER<<EOF user $USER $PASSWD mkdir Chanakya #To create directory with my name in $HOME ls > list put list bye... (5 Replies)
Discussion started by: Chanakya.m
5 Replies

8. UNIX for Dummies Questions & Answers

Ftping through unix script

Hi all, I am trying to write a script to connect to remote host and ftp some files there. The problem i am facing is,I dont know how to specify username and password for remote host through scripting. and even if i am able to connect to remote host,then how should i execute commands like mput... (17 Replies)
Discussion started by: Shiv@jad
17 Replies

9. AIX

GDG's on AIX

Hi, Does anyone have a solution they can share that will emulate Mainframe Generation Data Groups (GDG) on AIX? Thank You in Advance for Your Help, Lou (0 Replies)
Discussion started by: LouPelagalli
0 Replies

10. UNIX for Dummies Questions & Answers

FTPing backup files to another server

I am running a hot backup of my database every night within our cronjob. Recently I got burned because the tape which holds my backups became corrupt. I am setting up another Sun box to hold my backups as well as writing them to tape. I know dumb error on my part. My question is what will I... (10 Replies)
Discussion started by: fredlucas3
10 Replies
Login or Register to Ask a Question