Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Passing parameters from Jcl to Program thru linkage section

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
Roshnii

New User


Joined: 30 Sep 2008
Posts: 27
Location: bangalore

PostPosted: Thu Oct 09, 2008 5:36 pm    Post subject: Passing parameters from Jcl to Program thru linkage section
Reply with quote

Hi,

I need to pass the time from the jcl to my program using parms.

how do I go about this ?
Back to top
View user's profile Send private message
References
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 3544
Location: Brussels once more ...

PostPosted: Thu Oct 09, 2008 5:49 pm    Post subject:
Reply with quote

Is the program already written ?

If so, speak to the programmer to determine the method required by the program.

PARMS may be interpreted as either using the PARM= field on the exec card, or maybe //PARMS DD *, or PARMS DD whatever

Please be clear about your post.
Back to top
View user's profile Send private message
Robert Sample

Senior Member


Joined: 06 Jun 2008
Posts: 941
Location: Atlanta, GA

PostPosted: Thu Oct 09, 2008 5:53 pm    Post subject:
Reply with quote

Moreover, how are you getting the time in JCL? JCL merely executes programs and has no way to determine the time without invoking a program anyway.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 3544
Location: Brussels once more ...

PostPosted: Thu Oct 09, 2008 6:01 pm    Post subject:
Reply with quote

And if you do invoke a program to establish the time, you can not update the JCL to use the PARM= option as the JCL will already be interpreted by the JES sub system.

However this may be possible if using a job scheduling software.
Back to top
View user's profile Send private message
Roshnii

New User


Joined: 30 Sep 2008
Posts: 27
Location: bangalore

PostPosted: Thu Oct 09, 2008 6:03 pm    Post subject:
Reply with quote

the time will be manually put in the jcl. its like passing any value.

the program will accept it thru the linkage section


Code:

LINKAGE SECTION.                               
                                               
01 W300-PARM-VARIABLES.                         
   05 W300-PARM-LENGTH              PIC S9(4). 
   05 W300-PARM-DATA                PIC X(4).   


I tried in the jcl by passing like this

,PARM='0019'
where 0019 is the time but it did not work.
Back to top
View user's profile Send private message
Moved: Thu Oct 09, 2008 6:05 pm by superk From JCL to Mainframe COBOL
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 3544
Location: Brussels once more ...

PostPosted: Thu Oct 09, 2008 6:06 pm    Post subject:
Reply with quote

Have you tried

EXEC PGM=whatever,PARM='0019'
Back to top
View user's profile Send private message
dineshsjce
Warnings : 1

New User


Joined: 16 Apr 2007
Posts: 33
Location: Bangalore

PostPosted: Thu Oct 09, 2008 7:40 pm    Post subject: Reply to: Passing parameters from Jcl to Program thru linkag
Reply with quote

Hi,
Below is the use of PARM in a COBOL program. Try this way.

LINKAGE SECTION.
01 PARM-REC.
05 PM-LEN PIC S9(04) COMP.
05 DQ-FLG PIC X(01).
05 HD-FLG PIC X(01).
PROCEDURE DIVISION USING PARM-REC.


For the above COBOl code PARM in JCL looks like this:

EXEC PGM=Whatever, PARM='YY'.

Hope this will help you.
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8729
Location: 221 B Baker St

PostPosted: Thu Oct 09, 2008 10:25 pm    Post subject:
Reply with quote

Hello,

Quote:
where 0019 is the time but it did not work.
What does that mean?

If you want forum help, you have to provide something to work with.

"It did not work" is basically useless for problem solving. . .

When you clarify what problem(s) you encountered, someone will be able to tell you what is wrong.
Back to top
View user's profile Send private message
Terry Heinze

Active User


Joined: 14 Jul 2008
Posts: 176
Location: Richfield, MN, USA

PostPosted: Thu Oct 09, 2008 10:48 pm    Post subject:
Reply with quote

Roshnii,
W300-PARM-LENGTH must be usage BINARY (COMP or COMP-5).
Back to top
View user's profile Send private message
Sambhaji
Warnings : 1

Active User


Joined: 16 Feb 2007
Posts: 267
Location: Pune, India

PostPosted: Mon Oct 13, 2008 2:03 pm    Post subject:
Reply with quote

Check these too
http://www.ibmmainframes.com/viewtopic.php?t=34168&highlight=linkage
http://www.ibmmainframes.com/viewtopic.php?t=34167&highlight=linkage
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1