Hi All,
We have a requirement to Create sequential file only if any rows written into it, otherwise no need to create a sequential file.
please let me know you thoughts on how to acheive this task.
Thanks,
Satheesh
Create sequential file only if any rows written into it
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 182
- Joined: Thu Jun 16, 2005 2:05 am
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
or you can create the file with a different name and copy it to your expected output name if the size is greater than 0.
will assist you.
Code: Select all
test -s
Bottom line, Satheesh, is that your sequential file will always be created regardless of how many records are written to it, including zero. So you will either need some kind of 'work around' to fake this (as posted) or just live with and don't worry about it (which is what practically everyone does).
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 182
- Joined: Thu Jun 16, 2005 2:05 am
-
- Premium Member
- Posts: 892
- Joined: Thu Oct 16, 2003 5:18 am