FTP File Size



Post anything related to mainframes (IBM & UNISYS) if not fit in any of the above categories

FTP File Size

Postby GSerjo » Sat Nov 13, 2010 8:44 pm

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!
GSerjo
 
Posts: 6
Joined: Sat Nov 13, 2010 8:34 pm
Has thanked: 0 time
Been thanked: 0 time

Re: FTP File Size

Postby Robert Sample » Sat Nov 13, 2010 10:35 pm

What did the DIR command show you?
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: FTP File Size

Postby steve-myers » Sun Nov 14, 2010 12:49 am

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?
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: FTP File Size

Postby GSerjo » Sun Nov 14, 2010 3:53 am

Hi Robert Sample,

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

Steve-myers,

I've got thru the size windows file property
GSerjo
 
Posts: 6
Joined: Sat Nov 13, 2010 8:34 pm
Has thanked: 0 time
Been thanked: 0 time

Re: FTP File Size

Postby dick scherrer » Sun Nov 14, 2010 6:17 am

Hello,

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

Let us know how the DIR command works for you :)
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: FTP File Size

Postby GSerjo » Mon Nov 15, 2010 1:42 pm

Hi All,

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

Any ideas?
GSerjo
 
Posts: 6
Joined: Sat Nov 13, 2010 8:34 pm
Has thanked: 0 time
Been thanked: 0 time

Re: FTP File Size

Postby GSerjo » Mon Nov 15, 2010 1:50 pm

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!
GSerjo
 
Posts: 6
Joined: Sat Nov 13, 2010 8:34 pm
Has thanked: 0 time
Been thanked: 0 time

Re: FTP File Size

Postby GSerjo » Mon Nov 15, 2010 2:16 pm

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.
GSerjo
 
Posts: 6
Joined: Sat Nov 13, 2010 8:34 pm
Has thanked: 0 time
Been thanked: 0 time

Re: FTP File Size

Postby enrico-sorichetti » Mon Nov 15, 2010 2:25 pm

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 )
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: FTP File Size

Postby enrico-sorichetti » Mon Nov 15, 2010 2:40 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Next

Return to All other Mainframe Topics

 


  • Related topics
    Replies
    Views
    Last post