Reading a file from called program



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Re: Reading a file from called program

Postby pulsar22 » Tue Sep 24, 2013 11:13 am

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?
pulsar22
 
Posts: 34
Joined: Mon Sep 09, 2013 12:39 pm
Has thanked: 14 times
Been thanked: 0 time

Re: Reading a file from called program

Postby BillyBoyo » Tue Sep 24, 2013 1:19 pm

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.

These users thanked the author BillyBoyo for the post:
pulsar22 (Wed Sep 25, 2013 9:31 am)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Reading a file from called program

Postby pulsar22 » Wed Sep 25, 2013 9:03 pm

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?
pulsar22
 
Posts: 34
Joined: Mon Sep 09, 2013 12:39 pm
Has thanked: 14 times
Been thanked: 0 time

Re: Reading a file from called program

Postby BillyBoyo » Wed Sep 25, 2013 9:30 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Previous

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post