Page 2 of 2

Re: Reading a file from called program

PostPosted: Tue Sep 24, 2013 11:13 am
by pulsar22
Thanks Sir, changed the file name to 16 bytes and programs executes fine.
One question though: What changes should i make to STRING command to make better sense?

Re: Reading a file from called program

PostPosted: Tue Sep 24, 2013 1:19 pm
by BillyBoyo
Have a look at STRING in the manual, paying attention to DELIMITED BY. Also, for your fixed literals you can define items in WORKING-STORAGE, give them some good names, and then you'll not have a mass of stuff with no spaces in between which resolves to your final string.

If you use DELIMITED BY SPACE for the filename, then you are not restricted to 16 bytes only.

Re: Reading a file from called program

PostPosted: Wed Sep 25, 2013 9:03 pm
by pulsar22
Is the resource/CPU utilization in case of dynamic allocation substantially more than normal file reading? and also is it more than a normal select query on DB2 tables?

Re: Reading a file from called program

PostPosted: Wed Sep 25, 2013 9:30 pm
by BillyBoyo
Once the dynamic allocation has been done I'm not aware of any further overhead, but you should try it out. Code you example also as a fixed-definition file, and run that with a lot of records and your dynamic allocation with the same file. Compare the statistics.

Comparing the performance of a sequential file to a DB2 access cannot be generalised. If your SELECT is retrieving the data represented by the 5,491,359th record on a sequential file, DB2 is likely to be faster. If your SELECT is retrieving all the records in original order, the file access is (more than) likely to be faster.