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

Passing Value Through Parm Parameter


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rupesh gullu

New User


Joined: 12 Dec 2008
Posts: 96
Location: Gurgaon

PostPosted: Thu Jan 15, 2009 3:38 pm
Reply with quote

Hi,

can any one let me know if i am passing a value through Parm and not accepting it in my cobol program will it give me error. If yes what error it will give i mean the error code.

regards,
rupesh gupta
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Jan 15, 2009 3:39 pm
Reply with quote

Why not try it and see for yourself.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Jan 15, 2009 3:42 pm
Reply with quote

Hi,

if PARM is not defined in the program then it will just be ignored.


Gerry
Back to top
View user's profile Send private message
rupesh gullu

New User


Joined: 12 Dec 2008
Posts: 96
Location: Gurgaon

PostPosted: Thu Jan 15, 2009 4:15 pm
Reply with quote

Gerry,

it didn't gave me any error. I gave exec pgm=RGAUNDR,Parm='rupesh'

and submitted th jcl ot gave no error
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Thu Jan 15, 2009 4:20 pm
Reply with quote

Yes, it won't throw any error!
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 Jan 15, 2009 9:11 pm
Reply with quote

Hello,

If the code is not set up to use the parm, suggest it be removed from the jcl. . .

At best, this will cause someone confusion someday. . . icon_sad.gif
Back to top
View user's profile Send private message
prashanth1

New User


Joined: 27 Sep 2006
Posts: 47
Location: Hyderabad

PostPosted: Fri Jan 16, 2009 11:26 am
Reply with quote

Rupesh,

Have U declared Linkage section in cobol program with length and actual parameter ?
Back to top
View user's profile Send private message
rupesh gullu

New User


Joined: 12 Dec 2008
Posts: 96
Location: Gurgaon

PostPosted: Fri Jan 16, 2009 11:29 am
Reply with quote

hi Prashanth 1,

no i didnt declare linkage in program . I just wanted to see will jcl give any error if i dont give linkage.

rupesh
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Fri Jan 16, 2009 5:33 pm
Reply with quote

program will run sucessfully....but the data through the parm will not be available for the source program..
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Sat Jan 17, 2009 1:12 pm
Reply with quote

Hi,

This is like asking "if I code a DD startement in JCL executing my program but that program doesn't do any processing on that DD - what'll happen ?" - well, I would say this is nothing but bad coding practices & we must avoid such thing unless it's for learning purpose.

JCL, as been stated many times on this board, does nothing itself and merely executes programs - but then it needs all the information your program needs for a successful execution.

Your JCL is sending some information via PARM but program is just not bothered about it because nothing was told to it by the programmer so this question
Quote:
.. wanted to see will jcl give any error if i dont give linkage.
is actually ruled out; scope of "Linkage Section" is limited to your COBOL code unless it's been made aware that it might get some thing from "PARM"..
Back to top
View user's profile Send private message
rupesh gullu

New User


Joined: 12 Dec 2008
Posts: 96
Location: Gurgaon

PostPosted: Mon Jan 19, 2009 2:32 pm
Reply with quote

Hi Anuj,

I had just created that jcl for testing purpose...

I have one more doubt regading passing values through parm.

say i want to pass 1,2,3 to three variables .code is as shown:

exec pgm-test,parm= '1,2,3'

and in cobol i have linkage as shown:
linkage-section.

01 ws-variable.
49 ws-length pic x(4) comp.
49 ws-var1 pic x(1).
49 ws-var2 pic x(2).
49 ws-var3 pic x(1).

procedure division using ws-var2 ws-var1 ws-var3 or
procedure division using ws-var1 ws-var2 ws-var3

which one of these two procedure divisions will receive values and what will be the values received in variables.

regards,
rupesh
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Jan 19, 2009 3:52 pm
Reply with quote

Hi Rupesh,

Did ypu try the above at your end, what happened ?
Back to top
View user's profile Send private message
rupesh gullu

New User


Joined: 12 Dec 2008
Posts: 96
Location: Gurgaon

PostPosted: Mon Jan 19, 2009 7:19 pm
Reply with quote

hi anuj,

i tried with folowing syntax:

exec pgm=test,parm='123'

and in cobol i gave

linkage section.
01 ws-var.
05 ws-length pic s9(4) comp.
05 ws-var1 pic x(3).

it gave me ws-var as 123.

for that sntax which i asked you it gave me error as shown:
A "PICTURE" clause was not found for elementary item "WS-PARMLENGTH". "PIC

Operand "WS-VAR1 (ALPHANUMERIC)" was not defined as a level-01 or level-77

Operand "WS-VAR2 (ALPHANUMERIC)" was not defined as a level-01 or level-77

Operand "WS-VAR3 (ALPHANUMERIC)" was not defined as a level-01 or level-77

what i think i that u cannot get values in different variable. u will get value only of group variable in above case ws-var.

if you want to get value to var1 var 2 .. u have to move it one by one
let me know what i am saying is correct or not
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
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
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts Passing Parameters to Programs Invoke... PL/I & Assembler 5
Search our Forums:

Back to Top