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

Active User


Joined: 15 Aug 2015
Posts: 452
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

Active User


Joined: 15 Aug 2015
Posts: 452
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 Get two files from one file with diff... DFSORT/ICETOOL 10
No new posts View GDG data which is copied from a ... JCL & VSAM 2
No new posts How to read unpacked field created in... DFSORT/ICETOOL 11
No new posts How to add 2 digits to COMP-3 file? DFSORT/ICETOOL 11
This topic is locked: you cannot edit posts or make replies. I HAVE 2 INPUT FILES WITH SAME LAYOUT... COBOL Programming 6
Search our Forums:

Back to Top