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

What will parm-data1 contain in linkage section


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

New User


Joined: 23 Mar 2007
Posts: 8
Location: india

PostPosted: Mon Apr 23, 2007 4:51 pm
Reply with quote

01 parm-data1 pic s(4) comp.
01 parm-data2 pic x(4) .

what will parm-data1 contain...?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Apr 23, 2007 4:54 pm
Reply with quote

k_sanu4u wrote:
01 parm-data1 pic s(4) comp.
01 parm-data2 pic x(4) .
what will parm-data1 contain...?
Some of us may be experts, but I doubt any are psychic .......
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Apr 23, 2007 5:04 pm
Reply with quote

sanu,

Quote:
01 parm-data1 pic s(4) comp.
01 parm-data2 pic x(4) .

what will parm-data1 contain...?


In cobol, there is no need to pass the lenght of the (passing) variable. So parm-data1 value should come from the called program. I stand with William to predict the value. Only thing I can say, it should fall between -32768 through +32767.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Apr 23, 2007 5:17 pm
Reply with quote

Quote:
Some of us may be experts, but I doubt any are psychic .......

I Knew you were going to say that icon_lol.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Apr 23, 2007 5:17 pm
Reply with quote

k_sanu4u wrote:
01 parm-data1 pic s(4) comp.
01 parm-data2 pic x(4) .
what will parm-data1 contain...?

Now, if you really meant:
LINKAGE SECTION.
01 jcl-parm.
05 parm-data1 PIC S9(4) COMP.
05 aprm-data2 PIC X(4).
Then parm-data1 would contain the length of the parm value on the EXEC card, which should be at least 4 but might be longer or shorter.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Apr 23, 2007 5:22 pm
Reply with quote

William,

Quote:
Then parm-data1 would contain the length of the parm value on the EXEC card, which should be at least 4 but might be longer or shorter.


This is fine for CICS COBOL program. For a general cobol program, is not the calling program should pass the value betewen -32768 to +32767?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Apr 23, 2007 5:26 pm
Reply with quote

murmohk1 wrote:
This is fine for CICS COBOL program. For a general cobol program, is not the calling program should pass the value betewen -32768 to +32767?
Huh? Between the clues of "Post subject: linkage section", "Forum Index -> Mainframe COBOL" and "parm-data1 and parm-data2"........ icon_rolleyes.gif
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Mon Apr 23, 2007 5:31 pm
Reply with quote

William - excellent clarification, but why should the EXEC PARM be at least 4 in length?
Back to top
View user's profile Send private message
k_sanu4u

New User


Joined: 23 Mar 2007
Posts: 8
Location: india

PostPosted: Mon Apr 23, 2007 5:34 pm
Reply with quote

in param-data1 only S is defined inpic but actullay in comp the pic class can contain s and 9 ..so there is possiblity of error in that...?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Apr 23, 2007 5:45 pm
Reply with quote

Phrzby Phil wrote:
but why should the EXEC PARM be at least 4 in length?
Only "should", since it looks like he is intending to access up to four bytes and good practice is that you only access memory that is yours to access.....
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Apr 23, 2007 5:46 pm
Reply with quote

k_sanu4u wrote:
in param-data1 only S is defined inpic but actullay in comp the pic class can contain s and 9 ..so there is possiblity of error in that...?
I don't know, does it compile?
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Tue Apr 24, 2007 2:10 pm
Reply with quote

k_sanu4u wrote:
in param-data1 only S is defined inpic but actullay in comp the pic class can contain s and 9 ..so there is possiblity of error in that...?

I dont think s(4) comp will compile. icon_confused.gif
shouldn't it be s9(4) comp..?
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 COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts JCL EXEC PARM data in C Java & MQSeries 2
No new posts Need to specify PARM='POSIX(ON) Java & MQSeries 4
No new posts How to pass the PARM value to my targ... COBOL Programming 8
Search our Forums:

Back to Top