Page 1 of 2

FTP File Size

PostPosted: Sat Nov 13, 2010 8:44 pm
by GSerjo
Hi All,

How to get/calculate file size stored on ftp server?

Look's like FTP does not support SIZE command. So, I've send "LIST" command. I've received following string for "LINE" file

Volume Unit Referred Ext Used Recfm Lrecl BlkSz Dsorg Dsname
EXP004 3380 2010/11/13 1 120 VB 320 6404 PS LINE

I think, any algorithm for size calculation should be present?

My "LINE" file size is 3,59 МB (3 771 194 bytes).

So, how to get/calculate file size?

Thanks in advance for any help!

Re: FTP File Size

PostPosted: Sat Nov 13, 2010 10:35 pm
by Robert Sample
What did the DIR command show you?

Re: FTP File Size

PostPosted: Sun Nov 14, 2010 12:49 am
by steve-myers
z/OS does not store the byte count of a data set like Unix or Windows. All we can tell you from what you reported is the data set attributes appear to be RECFM=VB, LRECL=320, BLKSIZE=6404. One would hope this data set contains text data because it will be moderately difficult to transfer it using FTP if it contains any non-text data. Out of curiosity, where did you get the data set size is 3 771 194 bytes?

Re: FTP File Size

PostPosted: Sun Nov 14, 2010 3:53 am
by GSerjo
Hi Robert Sample,

I did not checked the 'DIR' command, I will.

Steve-myers,

I've got thru the size windows file property

Re: FTP File Size

PostPosted: Sun Nov 14, 2010 6:17 am
by dick scherrer
Hello,

I've got thru the size windows file property
After the transfer, correct?

Let us know how the DIR command works for you :)

Re: FTP File Size

PostPosted: Mon Nov 15, 2010 1:42 pm
by GSerjo
Hi All,

I've checked the "DIR" command. I've received following error "500 unknown command DIR" :(

Any ideas?

Re: FTP File Size

PostPosted: Mon Nov 15, 2010 1:50 pm
by GSerjo
Dick scherrer,

"After the transfer, correct?" No, I've checked file size on my PC, i.e. before upload file on ibm's ftp I've checked file size. So, how can I get uploaded file size?

Thanks in advance for any help!

Re: FTP File Size

PostPosted: Mon Nov 15, 2010 2:16 pm
by GSerjo
FYI,

I've submitted the same question on ibm's forum, please take a look. "https://www.ibm.com/developerworks/forums/thread.jspa?threadID=352465" Look's like unable to calculate actual file size thru "Volume Unit Referred Ext Used Recfm Lrecl BlkSz Dsorg Dsname" params.

Re: FTP File Size

PostPosted: Mon Nov 15, 2010 2:25 pm
by enrico-sorichetti
posting the same question on different forums is considered everywhere bad manners :evil:

review Your understanding of zOS/USS/MVS data management...

on the USS side the I/O is unix like ==> stream/byte oriented
and You can easily get the file size

on the MVS side is record oriented ( lrecl blksize and friends )
so there is no easy way of getting the byte count unless You ( as the word slightly hints ) COUNT them one by one
the only thing that is available is the eof position and the utilization counts are based on it but there are some formulas to apply
( blksize, device geometry )

Re: FTP File Size

PostPosted: Mon Nov 15, 2010 2:40 pm
by enrico-sorichetti
follow on ( finger check before completing the previous reply )

furthermore the count will never be exact for variable length record
( the block size will never be the same - it will always be <= than the dcb blksize )

for FB datasets the formula must properly account for the blocks in the last track

anyway on the MVS side nobody has ever cared about the exact byte count of anything :D