Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problem with PARM to COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Reply to: Parameter from JCL to COBOL
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Mon Jan 05, 2015 5:24 pm    Post subject: Reply to: Problem with PARM to COBOL
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Mon Jan 05, 2015 5:44 pm    Post subject: Reply to: Problem with PARM to COBOL
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: 1219
Location: Israel

PostPosted: Tue Jan 06, 2015 2:33 am    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Tue Jan 06, 2015 3:17 am    Post subject: Reply to: Problem with PARM to COBOL
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    Post subject: Reply to: Problem with PARM to COBOL
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Tue Jan 06, 2015 12:47 pm    Post subject: Reply to: Problem with PARM to COBOL
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us