View previous topic :: View next topic
|
Author |
Message |
rupesh gullu
New User
Joined: 12 Dec 2008 Posts: 96 Location: Gurgaon
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Why not try it and see for yourself. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
if PARM is not defined in the program then it will just be ignored.
Gerry |
|
Back to top |
|
|
rupesh gullu
New User
Joined: 12 Dec 2008 Posts: 96 Location: Gurgaon
|
|
|
|
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 |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Yes, it won't throw any error! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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. . . |
|
Back to top |
|
|
prashanth1
New User
Joined: 27 Sep 2006 Posts: 47 Location: Hyderabad
|
|
|
|
Rupesh,
Have U declared Linkage section in cobol program with length and actual parameter ? |
|
Back to top |
|
|
rupesh gullu
New User
Joined: 12 Dec 2008 Posts: 96 Location: Gurgaon
|
|
|
|
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 |
|
|
ibmmainframesyntel
Active User
Joined: 26 Feb 2007 Posts: 126 Location: Chennai
|
|
|
|
program will run sucessfully....but the data through the parm will not be available for the source program.. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
rupesh gullu
New User
Joined: 12 Dec 2008 Posts: 96 Location: Gurgaon
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi Rupesh,
Did ypu try the above at your end, what happened ? |
|
Back to top |
|
|
rupesh gullu
New User
Joined: 12 Dec 2008 Posts: 96 Location: Gurgaon
|
|
|
|
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 |
|
|
|