Detecting Multi-Segment Split File

Started by James Zukowski, January 27, 2023, 05:17:39 PM

Previous topic - Next topic

James Zukowski

Is there a way to determine if a file is a multi-segment split file? We've got embedded io routines that do additional work based on a file's name. We're looking at splitting some of our larger files.
We would like to be able to parse out the base filename only, rather than have the full path and segment ID included. Being able to determine when to do the additional parsing work would certainly help.
Thanks!
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

Loren Doornek

You can get the number of segments from the file header, as long as it's not an EFF file.

OPEN INPUT(1,ISZ=1)"MY_FILE";READ RECORD(1,SIZ=256)R$;CLOSE(1)
SEGMENTS=DEC($00$+MID(R$,249,1))
PRINT SEGMENTS

James Zukowski

Thanks, but i don't know if that will help us...
Is there a way to determine if a file is a segment in a segmented file? That's what's being provided by the fin(lfa,"Filename") to our embedded io routine. We only need the base filename, not the actual segment name.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

Mike King

James

What exactly are you looking for? 

Are you try to use multi-segment files to extend the maximum file size beyond 2GB while keeping all segment under the 2GB so older file systems can support the files.

Or are you looking to use the file splitting functionality that will allow you control which data goes to different files.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

James Zukowski

We're looking to segment the data by date, so the historical data doesn't need to be backed up all the time. We have existing embedded io routines that apply new data writes to other related files that are used for exporting to and updating other systems. These are defined by the base file name, not the segment's name.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services