|
Hey all, Ok, now it's really getting thick. I've decided to try and tackle userspaces to see if it will speed up my monster IFS posting job. i've got a pretty good idea what I'm doing, but i'm fuzzy on scanning the space once i've loaded it. see if this sounds ok so far. * open IFS csv file C eval $FD = Open(sfPath:flag:mode) * if open C if $FD <> *null * get size of file using stat() * (add a 100 bytes for safety) c eval statsize = %size(statds) c alloc statsize p_statDS c eval $filesize = st_size + 100 c dealloc p_statDS * create userspace (returns *off if error) c if CrtUsrSpc(USName:USLibr:$fileSize) * retrieve userspace pointer C eval USPtr = RtvUsrSpcPtr(USName:USLibr) C if USPtr <> *null * read from ifs file C eval rdlen=read($FD:USPtr:$fileSize) ... process user space here. c end c end c end ok, now i have my user space, it's loaded with the entire IFS file and I know how big it is. It is a cr/lf record delimited csv. I understand the concept of pointer math. to scan the data for each record, do I now have to define a string in my program based (at first anyway) on USPtr, with a length of what I think the maximum record length could be, and then scan that field for end of record to give me a beginning and end of the data I want to process? and then once processed, I just add that length to my pointer (+1) to start my scan for the next record? can that based string somehow be varying? is there another way to scan the userspace in-line without basing a variable to a pointer somewhere in the userspace? does this make sense? I don't have a problem writeing this thing based on what I've described above, but it just seems, oh, not very flexible - having to define a maximum record length and all. keep in mind, i'm writing this for processing speed, not for convenience. Oh, and one more thing: does a userspace created in QTEMP work the same as any other object in QTEMP? (i.e. each job can have it's own copy of the same named usrspc.) thanks a bunch, Rick
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.