Apologies for machine translation. I welcome the editors' help (it's been some time since the last time).
COBOL has no strings in the sense that there is no field with a terminal (such as a null or a newline) that COBOL would interpret as being the end of piece of data.
COBOL has fixed-length fields.
How does Oacle know how long your user password and password have? No.
You need to figure out how Oracle can understand the length of your data.
The first approach is to consult the Pro * COBOL (Oracle COBOL) documentation. There you will see a data definition including VARYING for the userid and password.
VARYING (in this particular context) belongs to Pro * COBOL. It would be considered a Language Extension for COBOL.
It is not clear which COBOL compiler you are using.
GnuCOBOL has ANYLENGTH, but is not (yet) available for WORKING-STORAGE settings. Micro Focus COBOL (if you are using one of them) can have ANYLENGTH or something equivalent: if you query the documentation / knowledgebase, I would hope you can find something.
However, it can be done in any simple COBOL, although you need to calculate the length of the data yourself (it will not be automatic, unlike VARYING and ANYLENGTH).
First, you need to understand how Oracle expects data to come to it from Pro * COBOL.
What VARYING actually does, can be defined as this:
01 Senha do usuário.
05 UP-Length COMP-5 PIC 9 (4).
05 UP-Username PIC X (30).
Oracle expects a "varchar" type. A binary of two bytes (integers) in length, immediatelt before the data.
You MOVE your required userid to UP-Username, then you would work out how many traiing blanks there are in the field, subtract that from 30, and put the result in UP-Length. Depending on the COBOL compiler you have, there are more or less easy ways to do this.
You need to do this for all "varchar" type fields.
Without the length before the data, Oracle would have used the first two data characters as a binary integer.
Original English:
COBOL does not have "strings", in the sense that there is no field with a terminal (like a null or a newline) which COBOL would interpret as being the end of piece of data.
COBOL has fixed-length fields.
How does Oacle know how long your userid and password are? It does not.
You need to find out how Oracle can understand the length of your data.
First approach is to consult the Pro * COBOL (Oracle's COBOL) documentation. There you will see a data-definition including VARYING for the userid and password.
VARYING (in that particular context) belongs to Pro * COBOL. It would be considered a Language Extension for COBOL.
It is not clear which COBOL compiler you are using.
GnuCOBOL does not have ANYLENGTH, but it is (yet) available for WORKING-STORAGE definitions. Micro Focus COBOL (if you happen to be using one of theirs) may have ANYLENGTH or something equivalent: if you consult their documentation / knowledgebase, I'd expect you to find something.
However, it can be done in any plain COBOL, although you need to work out the length of the data yourself (it will not be automatic, unlike the VARYING and the ANYLENGTH).
First, you need to understand how Oracle expects the date to arrive to it from * COBOL.
What the VARYING actually does, can be defined as this:
01 User-Password.
05 UP-Length COMP-5 PIC 9(4).
05 UP-Username PIC X(30).
Oracle expects to "varchar" -type. A two-byte binary (integer) length, immediatelt before the data.
You would MOVE your required userid to UP-Username, then you would work out how many traiing blanks there are in the field, subtract that from 30, and put the result into UP-Length. Depending on which COBOL compiler you have, there are more or less easy ways to do that.
You need to do that for all "varchar" -type fields.
Without the length before the date, Oracle would have used the first two characters of data as a binary integer.