Code Comments
Programming Forum and web based access to our favorite programming groups.All: I have another interesting scenario. I have a data item in a COBOL program that is declared as follows: EXEC SQL BEGIN DECLARE SECTION END-EXEC. 01 LogBuffer PIC X(262146) VARYING. EXEC SQL END DECLARE SECTION. The Pro*COBOL pre-compiler expands this to: 01 LogBuffer. 02 LogBuffer-LEN PIC S9(4) COMP. 02 LogBuffer-ARR PIC X(262146). As you can see - the exploded definition produced by Pro*COBOL is not correct. I cannot seem to find a decent way around this - does anyone have a good suggestion. Standard Info: COBOL: MF Server Express 4.0 SP1 Oracle: 9i Pro*COBOL: 1.8 (don't ask why ...) OS: HP-UX 11i Thanks in advance, Chris
Post Follow-up to this messageThat is right, because the length info of string is needed for intercommunication between COBOL and SQL modules. There are directions when using them: From COBOL to SQL, writing both , From SQL to COBOL, reading LogBuffer-ARR, Good luck, Thomas Li Corporola Inc. "Chris" <ctaliercio@yahoo.com> wrote in message news:1103294765.387986.37710@z14g2000cwz.googlegroups.com... > All: > > I have another interesting scenario. > > I have a data item in a COBOL program that is declared as follows: > > EXEC SQL BEGIN DECLARE SECTION END-EXEC. > > 01 LogBuffer PIC X(262146) VARYING. > > EXEC SQL END DECLARE SECTION. > > > The Pro*COBOL pre-compiler expands this to: > > 01 LogBuffer. > 02 LogBuffer-LEN PIC S9(4) COMP. > 02 LogBuffer-ARR PIC X(262146). > > > As you can see - the exploded definition produced by Pro*COBOL is not > correct. I cannot seem to find a decent way around this - does anyone > have a good suggestion. > > Standard Info: > > COBOL: MF Server Express 4.0 SP1 > Oracle: 9i > Pro*COBOL: 1.8 (don't ask why ...) > OS: HP-UX 11i > > > Thanks in advance, > Chris >
Post Follow-up to this messageThomas, Thanks for the feedback, but the reson I am saying that the Pro*COBOL exploded definition is wron is this: it only allows for a length of 9999. Clearly in this situation that maximum is insufficient. The LogBuffer field is being inserted into a CLOB column, so there is no reason to restrict the length of the string field here. Thanks, Chris
Post Follow-up to this messageThat is right, because the length info of string is needed for intercommunication between COBOL and SQL modules. There are directions when using them: From COBOL to SQL, writing both , From SQL to COBOL, reading LogBuffer-ARR, Good luck, Thomas Li Corporola Inc. "Chris" <ctaliercio@yahoo.com> wrote in message news:1103294765.387986.37710@z14g2000cwz.googlegroups.com... > All: > > I have another interesting scenario. > > I have a data item in a COBOL program that is declared as follows: > > EXEC SQL BEGIN DECLARE SECTION END-EXEC. > > 01 LogBuffer PIC X(262146) VARYING. > > EXEC SQL END DECLARE SECTION. > > > The Pro*COBOL pre-compiler expands this to: > > 01 LogBuffer. > 02 LogBuffer-LEN PIC S9(4) COMP. > 02 LogBuffer-ARR PIC X(262146). > > > As you can see - the exploded definition produced by Pro*COBOL is not > correct. I cannot seem to find a decent way around this - does anyone > have a good suggestion. > > Standard Info: > > COBOL: MF Server Express 4.0 SP1 > Oracle: 9i > Pro*COBOL: 1.8 (don't ask why ...) > OS: HP-UX 11i > > > Thanks in advance, > Chris >
Post Follow-up to this messageThomas, Thanks for the feedback, but the reson I am saying that the Pro*COBOL exploded definition is wron is this: it only allows for a length of 9999. Clearly in this situation that maximum is insufficient. The LogBuffer field is being inserted into a CLOB column, so there is no reason to restrict the length of the string field here. Thanks, Chris
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.