View previous topic :: View next topic
|
Author |
Message |
abhi7cool
New User
Joined: 05 Jan 2015 Posts: 3 Location: India
|
|
|
|
I have the same problem as this.
While passing parameter from JCL to COBOL the length is showing as 10.
Additional info. My code accesses DB2 and Datacom both.
Please let me know if you have any solution for this.
Thanks in advance.
Abhi. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You need to show your JCL for the step and the COBOL code (LINKAGE SECTION, USING and procedure code) and the output you are getting and what you expect. |
|
Back to top |
|
|
abhi7cool
New User
Joined: 05 Jan 2015 Posts: 3 Location: India
|
|
|
|
Hey Bill,
My cobol program goes like this
Code:
Code: |
WORKING-STORAGE SECTION.
01 WS-NAME PIC X(10) VALUE SPACES.
LINKAGE SECTION.
01 PARM-BUFFER.
05 PARM-LENGTH PIC S9(4) COMP.
05 PARM-NAME PIC X(10).
PROCEDURE DIVISION USING PARM-BUFFER.
MOVE 'ABC' TO WS-NAME.
DISPLAY WS-NAME.
DISPLAY PARM-NAME.
DISPLAY PARM-LENGTH.
STOP RUN. |
My Exec JCL is as below .
Code:
Code: |
//STEP1 EXEC PGM=TEST,
// PARM='XYZ'
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=* |
I'm getting the below result.
*************
when i'm using reference modification i'm getting below output
Code: |
ABC
" 0 " 0 " 0 " 0 " 0 " 0 " 0 " 0
00010 |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
That certainly is spookily similar to the original question :-)
How did you come up with your program?
As those who commented on the other question originally stated, that's not happening.
OK, you see it happening.
What does the JCL look like for an existing DB2 batch program? You can't just EXEC PGM=TEST if TEST is a DB2 program. I have no clue about DATACOM, let alone DATACOM and DB2 but I think that's your problem. If so, let us know, as it will actually answer the original question (where DB2 was not mentioned). |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Here is an answer also spookily similar to one of the original answers:
Quote: |
You must be doing something wrong. |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Program is using TRUNC(BIN) and something to get multiple bytes for those in the PIC X(10).
Can you paste your compile options (first page of the the compile listing) please? |
|
Back to top |
|
|
abhi7cool
New User
Joined: 05 Jan 2015 Posts: 3 Location: India
|
|
|
|
The issue has resolved. As my code has Datacom updation process it needs ENTRY coded at the beginning.
Thus Insetad of :
Code: |
PROCEDURE DIVISION USING PARM-BUFFER.
0000-MAINLINE.
ENTRY 'DBMSCBL'. |
I have coded :
Code: |
PROCEDURE DIVISION.
0000-MAINLINE.
ENTRY 'DBMSCBL' USING PARM-BUFFER. |
Thanks Bill and everyone else for your valuable inputs...
Regards,
Abhi |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
And a little change to the JCL as well. That would be useful to see.
Also I'd like to know how those 10 bytes became so long when they were DISPLAYed. Can you post the compile options, please? |
|
Back to top |
|
|
|