View previous topic :: View next topic |
Author |
Message |
Disco_Stu Beginner
Joined: 04 Feb 2003 Posts: 19 Topics: 7
|
Posted: Thu Aug 25, 2005 12:39 pm Post subject: Resize field in COBOL? |
|
|
I am passing a character string to a cobol program. A query is then going to be done on this string.
The max size is 40 characters. I need to size of the field used in the query to match the size of the string that is passed. For example, if the string being passed was "HELLO", I woud need that moved to a field defined as PIC x(5). Otherwise the trailing spaces will screw up my query.
The only option i've come up with is the create 40 working storage fields with lengths of 1-40. Then interrogate the passed field size and move to appropriate working storage field. That seems pretty ugly.
Anyone know of a better way? Can a field length be changed dynamically?
Thanks. |
|
Back to top |
|
 |
Disco_Stu Beginner
Joined: 04 Feb 2003 Posts: 19 Topics: 7
|
Posted: Thu Aug 25, 2005 12:43 pm Post subject: |
|
|
Think i just answered my own post. I can use SUBSTR(fieldname,start,length) in my SQL to point to the portion of the string that i want to use. |
|
Back to top |
|
 |
|
|