View previous topic :: View next topic
|
Author |
Message |
Ambili S
Active User
Joined: 06 Sep 2007 Posts: 112 Location: India
|
|
|
|
For a varchar data item , the following declaration is used.
01 A.
49 ws-len pic s9(4) comp.
49 ws-text pic x(3).
my query is how does ws-len get the value ? is it passed via parm in jcl , or do we pass it in cobol pgm ?
Thanks |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
when the var char column is to be updated or inserted via sql,
the length must be populated prior to execution of the sql.
DB2 will populate the length during a Select operation. |
|
Back to top |
|
|
Ambili S
Active User
Joined: 06 Sep 2007 Posts: 112 Location: India
|
|
|
|
Yes for DB2 it's as you said . But in simple COBOL pgm for a varchar declaration , how would the length be populated ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If level 49 is used, it is a db2 item (unless some mistake has been made).
The way a working-storage field of varying length is defined is usually with an OCCURS DEPENDING ON. |
|
Back to top |
|
|
|