|
View previous topic :: View next topic
|
| Author |
Message |
k_sanu4u
New User

Joined: 23 Mar 2007 Posts: 8 Location: india
|
|
|
|
01 parm-data1 pic s(4) comp.
01 parm-data2 pic x(4) .
what will parm-data1 contain...? |
|
| Back to top |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
| 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 |
|
 |
murmohk1
Senior Member
.jpg)
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
| Quote: |
| Some of us may be experts, but I doubt any are psychic ....... |
I Knew you were going to say that  |
|
| Back to top |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
| 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 |
|
 |
murmohk1
Senior Member
.jpg)
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
| 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"........  |
|
| Back to top |
|
 |
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1054 Location: Richmond, Virginia
|
|
|
|
| William - excellent clarification, but why should the EXEC PARM be at least 4 in length? |
|
| Back to top |
|
 |
k_sanu4u
New User

Joined: 23 Mar 2007 Posts: 8 Location: india
|
|
|
|
| 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 |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
| 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 |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
| 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 |
|
 |
agkshirsagar
Active Member

Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
| 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.
shouldn't it be s9(4) comp..? |
|
| Back to top |
|
 |
|
|