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: 7315

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: 7315

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: 1235
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: 7315

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: 7315

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
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts Problem commiting to DB2 from IMS MPP Ole Soerensen IMS DB/DC 2 Wed Jul 26, 2017 5:19 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm


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