FTP Mget - long file name



TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...

FTP Mget - long file name

Postby pszajn » Fri May 06, 2016 7:42 pm

Hi
I have a problem with FTP.
I need to download a file/files from Windows server to Mainframe server using MGET.
Unfortunalely my file/files located on Windows server have long names (longer than 8 characters) and I can't change length of filenames.

My JOB:

//TESTFTP  JOB (PK000U),'MBA FIL',CLASS=A,MSGCLASS=X
//FTPEXEC1 EXEC PGM=FTP,                            
//         PARM='10.3.4.112, (TRACE'                  
//SYSPRINT DD SYSOUT=*                              
//SYSTCPD  DD DSN=SYS1.TCPP(TCPDATX),DISP=SHR        
//SYSFTPD  DD DSN=SYS1.TCPP(FTPPOLX),DISP=SHR        
//SYSIN    DD *                                      
test test1234                                        
cd /transfer/in/sfa/                                
locsite recfm=fb                                    
locsite prim=500                                    
locsite sec=500                                      
locsite lrecl=1010                                  
mget MBA_INPUT_FILE_201604*.txt                      
close                                                
quit                                                
/*                                                  
 


I got that answer:
CG4060 rcvFile: local name conversion error (9)
CG4082 SETCEC code = 18
EZA1685W Invalid local file identifier


PC0384 parseCmd: parameter 1: lrecl=1010                                      
EZA2280W BLOCKSIze must be a multiple of LRecl for FB data sets.  BLOCKSIze set
EZA1460I Command:                                                              
EZA1736I mget MBA_INPUT_PILE_201604*.txt                                      
PC0359 parseCmd: subcommand:  mget                                            
PC0384 parseCmd: parameter 1: MBA_INPUT_PILE_201604*.txt                      
SC1349 initDsConnection: entered                                              
EZA1701I >>> PORT 10,249,5,2,53,12                                            
200 PORT command successful.                                                  
EZA1701I >>> NLST MBA_INPUT_PILE_201604*.txt                                  
150 Opening ASCII mode data connection for file list.                          
SC1854 accDsConnection: entered                                                
GU4946 ftpSetApplData: entered                                                
SC2655 dataClose: entered                                                      
226 Transfer complete.                                                        
CG0249 get: F=1 p=FSA ARTWT=00001                                              
CG3910 rcvFile: entered                                                        
MR1393 set_filename: entered with pathname MBA_INPUT_PILE_20160429.txt        
CG4060 rcvFile: local name conversion error (9)                                
CG4082 SETCEC code = 18                                                        
EZA1685W Invalid local file identifier                                        
EZA1460I Command:                                                              
EZA1736I close                                                                
PC0359 parseCmd: subcommand:  close                                            
CZ1342 ftpClose: entered                                                      
EZA1701I >>> QUIT                                                              
221-You have transferred 0 bytes in 0 files.                                  
221-Total traffic for this session was 497 bytes in 1 transfers.              
221-Thank you for using the FTP service on trandb1.                            
221 Goodbye.                                                                  
SC3376 endSession: entered (sn=172E37D0)                                      
CU2889 write_smf_record: entered with type -3.                                
CU1882 write_smfTable_record_119: entered with table index 2.                  
CU1694 subtype_103: entered                                                    
CU1752 build_security_section: entered                                        
SC2655 dataClose: entered                                                      
EZA1460I Command:                                                              
EZA1736I quit                                                                  
PC0359 parseCmd: subcommand:  quit                                            
CX0383 main: RC=00000 cmd_in_progress=100  
CX0386 main: last_reply=     err=00        
CZ1270 ftpQuit: entered                    
CZ1342 ftpClose: entered                    
CZ1342 ftpClose: entered                    
CX0516 removeAff: entered                                                        
 


File/files can't be downloaded to mainframe because have too long names. Is there any way to cut filenames to 8 characters or any other way to get file/files to mainframe? Maybe it is possible to define new filenames (or any file mask) on local side (on mainframe)?

Piter
pszajn
 
Posts: 2
Joined: Fri May 06, 2016 7:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: FTP Mget - long file name

Postby Robert Sample » Fri May 06, 2016 8:04 pm

You have some choices to make:
1. If you insist on using MGET, you retrieve the files into a Unix directory. You can then write code in the language of your choice to convert the file names in the directory to valid data set names and copy them to z/OS data sets. This is either a two- or three-step process depending upon how you write it.
2. Stop using MGET and use GET to retrieve the files into individual z/OS data sets. You do this by having an FTP step do a directory to retrieve the file names, parse them using a program in the language of your choice and creating the appropriate GET commands, then running those GET commands in a separate FTP step -- so you wind up with a three-step process.
3. Write a program on the Windows server in the language of your choice to convert the long file names into valid z/OS data set names before running your FTP job. This could run into timing issues if the mainframe FTP job is scheduled.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: FTP Mget - long file name

Postby pszajn » Sun May 08, 2016 10:56 pm

Thank You Robert for Your answer.
Honestly I thaught that is simpliest way to do that... maybe using any FTP features. I don't want to write any programs and make complex process from that.
pszajn
 
Posts: 2
Joined: Fri May 06, 2016 7:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: FTP Mget - long file name

Postby enrico-sorichetti » Sun May 08, 2016 11:15 pm

maybe using any FTP features

if there were an FTP feature Robert would have told You about it!
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3002
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: FTP Mget - long file name

Postby Robert Sample » Sun May 08, 2016 11:40 pm

If you want to use MGET, you receive whatever the file names are on the server -- period. So if those names do not match z/OS data set naming standards, then you cannot use MGET directly to z/OS data sets. I gave you your options but the bottom line is that your process will not work as currently designed. Either you change the process (which will require coding in some language) or you determine that those files cannot easily be placed on the mainframe and come up with another solution that does not involve FTP. Have you talked to your site support group to see what they suggest?
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to TSO & ISPF

 


  • Related topics
    Replies
    Views
    Last post