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
 

 

Quetions in passing data through PARM

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
herewego

New User


Joined: 20 Feb 2006
Posts: 14

PostPosted: Tue Nov 07, 2006 6:48 pm    Post subject: Quetions in passing data through PARM
Reply with quote

A) You are passing parm value ?ABCDE? to cobol programme through JCL. What will happen if you declare in linkage section 1) picx(5)

2)pic x(6)

3)pic x(4)


B) In cobol programme A you are calling Programe B using ws-va1,ws-va2,ws-va3.
1) what will happen if you call B using ws-va1,ws-va2 not using ws-va3.
2) what will happen in programme B

you have written procedure division using ws-va1,ws-va2 not using ws-va3
Back to top
View user's profile Send private message

DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Nov 07, 2006 8:15 pm    Post subject: Re: Quetions in passing data through PARM
Reply with quote

Quote:

A) You are passing parm value ?ABCDE? to cobol programme through JCL. What will happen if you declare in linkage section 1) picx(5)

2)pic x(6)

3)pic x(4)


First, your definition in linkage needs to include a length as PIC S9(4) COMP.

i.e.
01 JCL-PARM.
05 PARM-LEN PIC S9(4) COMP.
05 PARM-STRING PIC X(??).

Second, the definition in LINKAGE section does not allocate storage; it only defines the storage that is passed to you. So in your example, regardless of how you have the storage defined, the storage will contain:

01 JCL-PARM.
05 PARM-LEN PIC S9(4) COMP VALUE 5.
05 PARM-STRING PIC X(??) VALUE ?ABCDE?.

Whenever you process the PARM, you need to interrogate the PARM-LEN to see how long the PARM-STING is. If the PARM-LEM = 0, no parm exists.

So, the PIC X(5) = ?ABCDE?
PIC X(6) = ?ABCDE.? The ?.? Is an undefined value, usually binary zeros
PIC X(4) = ?ABCD?

Dave
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Tue Nov 07, 2006 9:16 pm    Post subject:
Reply with quote

Hi !

You always have to take care, that the structure in the Linkage corresponds to the receiving Parameters. Also take care of the LengthField, as DavidK told you before.

Regards, UmeySan
Back to top
View user's profile Send private message
herewego

New User


Joined: 20 Feb 2006
Posts: 14

PostPosted: Wed Nov 08, 2006 1:35 pm    Post subject: Re: Quetions in passing data through PARM
Reply with quote

Dave,

Thanks for the reply.

I know that passing parameter is 'ABCDE' of lengh 5. So I don't understand why do we need to allocate PARM-LEN as S9(4) COMP.

Thanks,
Herewego
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Wed Nov 08, 2006 1:59 pm    Post subject:
Reply with quote

Hi !

You allways have to declare the PARM-LEN as S9(4) COMP, because this
field is used and insertet by system mechanisem automaticaly before the
real parameters.

regards, UmeySan
Back to top
View user's profile Send private message
vijay_bn79

New User


Joined: 20 Nov 2006
Posts: 48
Location: Hyderabad

PostPosted: Fri Nov 24, 2006 5:38 pm    Post subject: Re: Quetions in passing data through PARM
Reply with quote

S9(4) Comp takes 2 bytes

in linkage section expects 2 bytes of length variable

so we should give S9(4) comp in linkage section
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Nov 25, 2006 5:17 am    Post subject:
Reply with quote

Hi HWG,

The len field is used to verify that the field is the len you expected. You would check that as you would the content if the field is to be alpha or numeric for example.

It's not a good idea to assume.
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 Paasing symbolic parameter to instrea... Anirudh Anand JCL & VSAM 0 Thu Jul 27, 2017 1:22 pm
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts Passing data from REXX to C programme... chong.zhou All Other Mainframe Topics 0 Wed Jul 26, 2017 4:55 pm
No new posts copying data without knowing location arunsoods DFSORT/ICETOOL 8 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm


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