Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us