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

Not able to display data passed thru PARM from JCL


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

New User


Joined: 05 Mar 2005
Posts: 65
Location: Hyderabad

PostPosted: Thu Apr 17, 2008 12:59 am
Reply with quote

Hi,
I have to use a value in the cobol program which is sent thru JCL, I am using PARM for this purpose.

My cobol linkage looks as

Code:
 LINKAGE SECTION.
 01  PROGRAM-LINKAGE.
     05  PARM-LEN                    PIC S9(04) COMP.
     05  PARM-DATA               PIC X(08).

 PROCEDURE DIVISION USING PROGRAM-LINKAGE.

 0000-MAIN-PARA.

     DISPLAY 'PARM-DATA: ' PARM-DATA
     DISPLAY 'PARM-LEN: ' PARM-LEN



My JCL step looks as
Code:
//STPE0010  EXEC PGM=ABCDEF,PARM='00000002'
//


when i run this JCL i am seeing spaces in the spool, below is how my spool looks

Code:
********************************* TOP OF DATA ****************
PARM-DATA:
PARM-LEN: 00010
******************************** BOTTOM OF DATA *************


can someone let me know why I am not able to see the data which I am passing from my JCL

Thanks in advance
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Apr 17, 2008 1:24 am
Reply with quote

Well, IIRC, the length is correct....
I would try next DISPLAY 'PARM-DATA:*' PARM-DATA '*' and hex display the line between the two askericks....
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Apr 17, 2008 3:22 am
Reply with quote

Hello,

This code:
Code:
         *                                               
           LINKAGE SECTION.                               
           01  PROGRAM-LINKAGE.                           
               05 PARM-LEN PIC 9(4) COMP.                 
               05 PARM-DATA PIC X(8).                     
          *                                               
           PROCEDURE DIVISION USING PROGRAM-LINKAGE.     
               DISPLAY 'PARM-LEN  ' PARM-LEN.             
               DISPLAY 'PARM-DATA ' PARM-DATA.           
               GOBACK.                                   


executed with this jcl:
Code:
//X        EXEC PGM=DSCHCOBX,PARM='1234567'


gives:
Code:
PARM-LEN  0007   
PARM-DATA 1234567


Quote:
Well, IIRC, the length is correct....
I believe the length will be the number ov characters between the quotes.

The length of 10 leads me to believe the wrong version of the program (or the wrong program) may be executed.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Apr 17, 2008 3:31 am
Reply with quote

dick scherrer wrote:
CICS Guy wrote:
Well, IIRC, the length is correct....
I believe the length will be the number ov characters between the quotes.
I did preface it withan IIRC....grin....
Back to top
View user's profile Send private message
rammraju

New User


Joined: 05 Mar 2005
Posts: 65
Location: Hyderabad

PostPosted: Thu Apr 17, 2008 5:39 am
Reply with quote

This is a new program I am writing, so there is no chance of another version being excuted.

What I observed from the outputs is the output data is never changing, its showing the same for any value I am sending thru PARM
Code:
********************************* TOP OF DATA ****************
PARM-DATA:
PARM-LEN: 00010
******************************** BOTTOM OF DATA *************


PARM-DATA in hex looks as, this is also same for every value I am passing thru the PARM

Code:
00003E00
00010100
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Apr 17, 2008 5:47 am
Reply with quote

Hello,

Please post the jcl you are using for this job.

It may help if you post more of the code as well (not the entire program).
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Apr 17, 2008 5:49 am
Reply with quote

Try changing your program as CICS Guy suggested and retesting it. Something is not as you think it is.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Apr 17, 2008 5:55 am
Reply with quote

Hello,

Quote:
This is a new program I am writing, so there is no chance of another version being excuted.
What if some other module of that name already existed in the joblib/steplib concatenation.

It might be interesting to to add some more literal displays that do not refer to the linkage section.

Also, a question. Are the displays you posted the first instructions executed in the program? I am wondering if somehow storage got "walked on".
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Apr 17, 2008 6:04 am
Reply with quote

rammraju wrote:
PARM-DATA in hex looks as, this is also same for every value I am passing thru the PARM
Code:
00003E00
00010100
My skepticalism would be yelling at me at this point.
My solution would to put a unique display (compile date?...'hello, this is test 1A', anything...) into the display to insure I was seeing the execution of the program I thought I was executing....
Back to top
View user's profile Send private message
rammraju

New User


Joined: 05 Mar 2005
Posts: 65
Location: Hyderabad

PostPosted: Thu Apr 17, 2008 6:25 am
Reply with quote

I deleted the program and restaged it, it went well.

Being curious I would check why it did not happen before.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Apr 17, 2008 6:43 am
Reply with quote

rammraju wrote:
IBeing curious I would check why it did not happen before.
I really can't help you there, but, as I've learned, when the impossible is happening, you have (obviously) missed something...
Sometimes plugging a unique phrase or date/time into a display will prove or disprove that you are actually executing the program you think (are sure) you are actually executing....
Been there, done that, 'got the T-Shirt'....sometimes the simplest errors can 'cloud' the thinking....
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Apr 17, 2008 7:06 am
Reply with quote

Quote:
I deleted the program and restaged it, it went well.
Good to hear that it is now working icon_smile.gif

Unfortunate that we didn't get to learn why. . . icon_neutral.gif

d
Back to top
View user's profile Send private message
rammraju

New User


Joined: 05 Mar 2005
Posts: 65
Location: Hyderabad

PostPosted: Thu Apr 17, 2008 7:15 am
Reply with quote

I totally agree CICS GUY, its the way to learn things...

Going back, before deleting the component I have tried putting a unique display
Code:
DISPLAY '1'
and incremented it whenver I was compiling it again (as suggested by you). The new display code was being displayed but PARM data never came up.

This made me think on the storage part, hence I deleted and restaged; and it worked.
Back to top
View user's profile Send private message
rammraju

New User


Joined: 05 Mar 2005
Posts: 65
Location: Hyderabad

PostPosted: Thu Apr 24, 2008 4:56 am
Reply with quote

I was able to recreate the problem and this time I found the culprit.

It is the compiler option
Code:
CICS(''NOCBLCARD,SP'')
which is causing the problem.
When I try to remove this and compile/run the program, it is taking the PARM data supplied from the JCL.

Now the thing I have to find out is what is this compiler option doing

Thanks
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Apr 24, 2008 5:51 am
Reply with quote

rammraju wrote:
It is the compiler option
Code:
CICS(''NOCBLCARD,SP'')
which is causing the problem.
Why do you have a CICS translator option in (what looks like) a batch compile?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Apr 24, 2008 6:12 am
Reply with quote

Hello Ram,

Thank you for the followup icon_smile.gif

Hopefully, your system has standard compile jcl procs. Some for CICS, some for batch, some for database, etc and combinations. It is a very dangerous practice for each developer to have their own and not use common procs. . .

Might it be that the batch job was simply compiled with other than the standard batch compile jcl?
Back to top
View user's profile Send private message
rammraju

New User


Joined: 05 Mar 2005
Posts: 65
Location: Hyderabad

PostPosted: Thu Apr 24, 2008 6:13 am
Reply with quote

Its an option we have to uncheck while compiling batch programs from our version control tool (changeman). Apparently it was overlooked and had this issue come on.

Thanks
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 Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts JCL EXEC PARM data in C Java & MQSeries 2
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
Search our Forums:

Back to Top