IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need help to concatenate files with wildcard file name


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ssuthagar

New User


Joined: 03 Oct 2017
Posts: 6
Location: United States

PostPosted: Fri May 15, 2020 1:39 am
Reply with quote

Hi Serniors,

My requirement is to get the number of files from UNIX MID server to OMVS. I need to concatenate these files from UNIX box or in OMVS. I tried below command to concatenate files after getting into the respective directory

cat *.csv > infile1.csv

infile1 is my output file.

I am getting an error as below
sftp> cat *.csv > infile1.csv
FOTS0822 Invalid command.

Can someone thrown some light on how to handle this situation.

Thanks,
Suthagar
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1252
Location: Bamberg, Germany

PostPosted: Fri May 15, 2020 5:45 am
Reply with quote

As you seem to be working interactively from within the sftp command, you should switch to the shell first.
Code:
sftp>!
cat *.csv > infile1.csv
exit
sftp> .. whatever you need to do the put/get
Back to top
View user's profile Send private message
ssuthagar

New User


Joined: 03 Oct 2017
Posts: 6
Location: United States

PostPosted: Fri May 15, 2020 5:57 am
Reply with quote

Thanks,

My original script is

Code:
cd /nextgen/fwss_data/incoming                                   
# List contents of mid server before getting files to OMVS       
ls -l                                                           
cat *.csv > infile1.csv                                         
ls -l                                                           
ascii                                                           
 get /nextgen/fwss_data/incoming/infile1.csv /u/cscsxa/new/fwss1
 rm  /nextgen/fwss_data/incoming/infile1.csv                     
ls -l                                                           


I am getting an error at
Code:
cat *.csv > infile1.csv
as
sftp> cat *.csv > infile1.csv
FOTS0822 Invalid command.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1252
Location: Bamberg, Germany

PostPosted: Fri May 15, 2020 6:39 am
Reply with quote

cat is not a valid sftp command (see man page). Do the concat before you call the ftp script.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top