0

I want to copy a mvs file to my PC.. I have tried with the below code.

//JOBNAME JOB NOTIFY=&SYSUID,CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),  
 //         REGION=0M                                              
 //STEP01   EXEC PGM=FTP                                                                    
 //OUTPUT   DD SYSOUT=*                                            
 //SYSPRINT DD SYSOUT=*                                            
 //INPUT    DD *                                                   
 MVS IP ADDRESS                                                    
 USER.ID(MVS)                                                           
 PASSWORD                                                           
 PUT 'USERID.NEW1.TXT' C:\MYPATH\DATA.TXT               
 QUIT                                                              
 /*          

spool output shows

'Invalid data set name "c:\mypath\data.txt". Use MVS Dsname conventions.'

But it is working fine with MVS to MVS dataset but not with PC. Can anyone suggest me what has to be done further.

Ruthra
  • 15
  • 5
  • Your job is connecting to an MVS box not a PC. Do you have an FTP server running on your Windows PC? I very much doubt it. You can start and FTP server on Windows using IIS but almost nobody does that because it's considered a security risk. – David Crayford Aug 02 '17 at 08:31
  • Thanks for your response. I have ftp server on my PC. I have searched all the sites and this was the syntax mentioned.. – Ruthra Aug 02 '17 at 09:02
  • you would be better off just connecting to the FTP using either an FTP client or even a windows cmd prompt. – SaggingRufus Aug 02 '17 at 19:21
  • You have your senses reversed; all the control cards, except for the PUT, are all for sending to z/OS. If you do want to do this, I recommend as well that you use CD and LCD to navigate and then use just the file names in the PUT. – zarchasmpgmr Aug 02 '17 at 23:10

1 Answers1

0

If you do have an FTP server running on your PC, or a Windows server then it's simple to FTP using batch. Although the syntax you specified using a drive like C:\path\file is not supported. FTP commands and directory structures are similar Unix. When you configured the FTP server you would have specified a root directory (folder) that clients can access. You can't just access the entire Windows file system.

This JCL will work.

//FTPSTEP  EXEC PGM=FTP,REGION=0M        
//SYSPRINT DD  SYSOUT=*                  
//INPUT    DD  *                         
*windows-ip-address*                     
*windows-username windows-password*    
put 'USERID.NEW1.TXT' new1.txt           
quit  
David Crayford
  • 571
  • 1
  • 3
  • 10
  • Are you sure you have an FTP server running on Windows? Post your JCL and the error. – David Crayford Aug 08 '17 at 11:28
  • Yes, i m sure about that..I used the same code which you have shared..It was not a error..could not connect **..Connection to server interrupted or timed out. Initial connection..** – Ruthra Aug 09 '17 at 06:44
  • You need to make sure your Windows firewall settings are correct for the FTP server https://www.windowscentral.com/how-set-and-manage-ftp-server-windows-10. – David Crayford Aug 09 '17 at 10:02