Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Need help to concatenate files with wildcard file name

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
ssuthagar

New User


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

PostPosted: Fri May 15, 2020 1:39 am    Post subject: Need help to concatenate files with wildcard file name
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: 250
Location: Bamberg, Germany

PostPosted: Fri May 15, 2020 5:45 am    Post subject:
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: 3
Location: United States

PostPosted: Fri May 15, 2020 5:57 am    Post subject:
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: 250
Location: Bamberg, Germany

PostPosted: Fri May 15, 2020 6:39 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to remove remote file older than ... ssuthagar All Other Mainframe Topics 4 Thu Jun 04, 2020 6:26 am
No new posts How to fetch the latest record from a... Dinesh Mani DFSORT/ICETOOL 8 Tue Jun 02, 2020 5:34 pm
No new posts Compare multiple files using JCL/Rexx... tanvi110788 JCL & VSAM 4 Tue May 19, 2020 5:47 pm
No new posts concatenate sysin to dsn jzhardy JCL & VSAM 7 Fri May 15, 2020 5:35 am
No new posts COBOL Student learning COBOL File Han... torrind COBOL Programming 3 Sat May 09, 2020 3:40 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us