View previous topic :: View next topic |
Author |
Message |
Martin Beginner

Joined: 20 Mar 2006 Posts: 133 Topics: 58
|
Posted: Wed Feb 21, 2007 12:54 pm Post subject: Size of the file. |
|
|
Hi,
A nightly job creates a file . I need to find out the size of the file and based on the size I need to make a decision of whether to FTP the file or not.
Is batch way to find out the size of the file ? (KB,MB... )
-Mt |
|
Back to top |
|
 |
superk Advanced

Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Wed Feb 21, 2007 1:55 pm Post subject: |
|
|
I'd use SORT to create a record count, then decide based on the number of records. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Feb 21, 2007 1:58 pm Post subject: |
|
|
Martin,
you can have a rough estimate of total bytes by this formula
Code: |
total bytes = Lrecl * Record count
|
So if your lrecl is 80 and you 620 records then total bytes = 80 * 620 = 49,600
1 KB = 1024 bytes
1 MB = 1024 * 1024 bytes.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
ofer71 Intermediate
Joined: 12 Feb 2003 Posts: 358 Topics: 4 Location: Israel
|
Posted: Thu Feb 22, 2007 1:14 am Post subject: |
|
|
You cam add a step with REXX, and set a return code based on the size.
O.
________
Mercedes-Benz W460 history
Last edited by ofer71 on Sat Feb 05, 2011 11:57 am; edited 1 time in total |
|
Back to top |
|
 |
slade Intermediate
Joined: 07 Feb 2003 Posts: 266 Topics: 1 Location: Edison, NJ USA
|
Posted: Thu Feb 22, 2007 10:27 pm Post subject: |
|
|
Martin,
Why not put a rec ctr in the pgm that creates the file, then use Kolusu's equation to calc the file size. Set a RC for the ftp step based on the calc.. _________________ Regards, Jack.
"A problem well stated is a problem half solved" -- Charles F. Kettering |
|
Back to top |
|
 |
|
|