IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem with PARM to COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
abhi7cool

New User


Joined: 05 Jan 2015
Posts: 3
Location: India

PostPosted: Mon Jan 05, 2015 5:12 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jan 05, 2015 5:24 pm
Reply with quote

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
View user's profile Send private message
abhi7cool

New User


Joined: 05 Jan 2015
Posts: 3
Location: India

PostPosted: Mon Jan 05, 2015 5:29 pm
Reply with quote

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.

Code:
ABC

00010


*************

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jan 05, 2015 5:44 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Jan 06, 2015 2:33 am
Reply with quote

Here is an answer also spookily similar to one of the original answers:
Quote:
You must be doing something wrong.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jan 06, 2015 3:17 am
Reply with quote

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
View user's profile Send private message
abhi7cool

New User


Joined: 05 Jan 2015
Posts: 3
Location: India

PostPosted: Tue Jan 06, 2015 12:24 pm
Reply with quote

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... icon_smile.gif

Regards,
Abhi
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jan 06, 2015 12:47 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top