to accept a value in cobol



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

to accept a value in cobol

Postby nagendra » Thu Jul 22, 2010 2:57 pm

How to accept a value for a variable, in cobol using jcl. I'm confused regarding this concept..

can any one please help me to check it out. .....
Nagendra
nagendra
 
Posts: 21
Joined: Mon Jul 19, 2010 12:18 pm
Location: bangalore
Has thanked: 0 time
Been thanked: 0 time

Re: to accept a value in cobol

Postby NicC » Thu Jul 22, 2010 3:25 pm

Well, you are not explaining it all that well. Do you mean passing a parameter from JCL to COBOL? If so, (1) - look up how to code a parameter on the EXEC PGM= statement in the JCL manual and (2) - look up how to code the variable it is to be stored in in the Cobol program. I think it is in the LINKAGE SECTION. Your PROCEDURE DIVISION will need the USING keyword.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: to accept a value in cobol

Postby nagendra » Thu Jul 22, 2010 3:59 pm

NicC wrote:Well, you are not explaining it all that well. Do you mean passing a parameter from JCL to COBOL? If so, (1) - look up how to code a parameter on the EXEC PGM= statement in the JCL manual and (2) - look up how to code the variable it is to be stored in in the Cobol program. I think it is in the LINKAGE SECTION. Your PROCEDURE DIVISION will need the USING keyword.



yaa, k thanx..

but my question was...

when we are compiling cobol programs through jcl,

then if i m giving accept command it is saying some internal errors...

so, how to solve this problem.......
Nagendra
nagendra
 
Posts: 21
Joined: Mon Jul 19, 2010 12:18 pm
Location: bangalore
Has thanked: 0 time
Been thanked: 0 time

Re: to accept a value in cobol

Postby NicC » Thu Jul 22, 2010 4:05 pm

You are having compile problems? You did not say that before, you inferred that you were trying to receive into your program a value passed through the JCL parameter and didn't know how to code it. You should post your error messages and the piece of code that it refers to.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: to accept a value in cobol

Postby Robert Sample » Thu Jul 22, 2010 4:38 pm

1. Use the ACCEPT verb -- but be aware that ACCEPT is generally not allowed in production programs at most sites.

2. Use a DD name, allocate the file, and OPEN / READ / CLOSE the file like normal.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: to accept a value in cobol

Postby nagendra » Thu Jul 22, 2010 4:55 pm

thanx a lot..

i got a solution here, by just.. testing and by the suggestion given by. mr.ramesh..


well thanx a lot for.... suggesting me....


i just cleard one concept....

thanx a lot...
Nagendra
nagendra
 
Posts: 21
Joined: Mon Jul 19, 2010 12:18 pm
Location: bangalore
Has thanked: 0 time
Been thanked: 0 time

Re: to accept a value in cobol

Postby nagendra » Thu Jul 22, 2010 5:00 pm

this was my question...........................
...................................................

I checkd every thing...

if i m just initialising the variable and then compiling the cobol program through jcl naa

its successful, maxcc=0, and output is also correct..

if in case of initialising if i m just declaring it in working storage section,

and then i m trying for accepting the value in procedure section as,

accept a.

then here in case of accept, its giving error.....

why this is not compiling correct.
Nagendra
nagendra
 
Posts: 21
Joined: Mon Jul 19, 2010 12:18 pm
Location: bangalore
Has thanked: 0 time
Been thanked: 0 time

Re: to accept a value in cobol

Postby NicC » Thu Jul 22, 2010 5:02 pm

Possibly because you are not ACCEPTing FROM but I am not sure about this for parms from the JCL.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: to accept a value in cobol

Postby Robert Sample » Thu Jul 22, 2010 5:16 pm

Why not post the actual lines of code and error message with the message number on the front of it so we know exactly what you're getting? With all due respect, actual output from the computer is vastly better than your word about what is happening. And please use the Code button when posting this information so spaces are preserved!
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post