USS on the mainframe has the wc utility installed. Assuming you have to run your utility on a distributed system you could use FTP to submit a JCL job that used bpx batch to run the wc utility on the USS file you’re interested in. You could pipe the wc output to a file and then retrieve that file for use in your utility.
FTP and get row count from a file
Question
FTP Server - xxx.xx.xxx.xxx (Mainframe)
Unix
$> ftp xxx.xx.xxx.xxx
$> get filename
Problem
In the utility , we want to get row count from a file.
It can be done by :
Get the file in UNIX path using ftp
Apply
wc -l
on that file.
But we have few issues on the above technique:
Space issue (File size > 100 GB).
Resource and time consuming.
Any easy solution to get row-count from a file using FTP.
Solution
OTHER TIPS
Suggestion:
Create some script or program that periodically check the number of line and write it to a file, eg number_of_line.txt
Ftp the file number_of_line.txt and extract the information.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow