Page 3 of 3

Re: how to read an excel file and load the only selected col

PostPosted: Fri Jun 29, 2012 8:32 pm
by NicC
Do it with sort - easy. The difficult part may be in omitting the headers but that is probably an OMIT when you do a subsring search in the first few bytes looking for 'CURRENT'.

Unless when you need a new output file when you get a new header? How many columns are there? This is important as you can only parse 100 columns. If you have more than `00 then you need to parse the first 99 then parse the remaining columns into 1 field which can be parsed in a second pass of the data. At least, I think that is how you go about it. A Rexx program would do this in next to no time.

Re: how to read an excel file and load the only selected col

PostPosted: Fri Jun 29, 2012 9:51 pm
by dick scherrer
Hello,

If you have more than 100 fields or the file has millions of records, i would use neither the sort nor REXX. There is no good reason to pass the file multiple times. There is also no good reason to inflict the resource drain of REXX reading/writing lots of records when copying the file. (Unless your family gets to bill for resource usage).

The COBOL code to do what you want is quite basic and might only take a cpouple of hours - and most of that would be defining the indivisual gields and coding the UNSTRING to copy the data from the entire-record field to the individual fields.