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: 388
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: 388
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 Converting a file from PD to display ... SYNCSORT 4
No new posts Record count of RECFM=U tape file DFSORT/ICETOOL 17
This topic is locked: you cannot edit posts or make replies. Write Character to Hexadecimal file w... COBOL Programming 8
No new posts Checking the total counts inside a re... JCL & VSAM 5
No new posts File-aid batch how to repeat a line... Compuware & Other Tools 2
Search our Forums:

Back to Top