Using the Select into for ADS
Posted: Tue Sep 06, 2016 12:16 pm
Roger,
Ran across an issue with this and not sure what the best alternative is, or if you have another suggestion.
In some cases, especially on those requests with a date range, there may be no records selected. This routine is used in hundreds of programs, so thinking about maybe one solution without updating and testing each one individually. The no records will be rare, but do not want to have a chance of any errors.
For example:
for ADS:
Select into zz013999 from oppro where opconscode=123456 and flag="T' order by oppronum
For Alaska
use oppro
sort on oppronum to zz013999 for opconscode=123456 .and. flag="T"
Later in the code the file zz013999 is opened. If no records exist the user receives a message to that effect.
When using the ADS no file is created.
I think the best method is to use my ADS function call that creates the file and check to see if that file exists before going back to the calling program, and if not, create an empty file from OPPRO (in this example) . Any thoughts, or what command is best in ADS to do that?
(I hope this makes sense)
Thanks,
Fred
Ran across an issue with this and not sure what the best alternative is, or if you have another suggestion.
In some cases, especially on those requests with a date range, there may be no records selected. This routine is used in hundreds of programs, so thinking about maybe one solution without updating and testing each one individually. The no records will be rare, but do not want to have a chance of any errors.
For example:
for ADS:
Select into zz013999 from oppro where opconscode=123456 and flag="T' order by oppronum
For Alaska
use oppro
sort on oppronum to zz013999 for opconscode=123456 .and. flag="T"
Later in the code the file zz013999 is opened. If no records exist the user receives a message to that effect.
When using the ADS no file is created.
I think the best method is to use my ADS function call that creates the file and check to see if that file exists before going back to the calling program, and if not, create an empty file from OPPRO (in this example) . Any thoughts, or what command is best in ADS to do that?
(I hope this makes sense)
Thanks,
Fred