Return-code

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
venky
Active Member
Posts: 50
Joined: Sat May 12, 2012 10:13 pm

Return-code

Post by venky » Wed Oct 16, 2013 8:00 pm

Hi All,

As we know that Return-code is to send condition code(maxcc) when we submit the job based on logic in our program.

Is there is any parameter like Return-code to send Alphabetic data instead of numeric data.

like i want to display message in alphabetic after submitting the job as we are getting it for return-code.

eg:

move '8' to retrun-code.

I want to display like below.

move 'data is not matching' to return-code.

let me know the parameter for getting the message.

Regards,
Venky.

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Wed Oct 16, 2013 9:52 pm

First, return-code is NOT maxcc.

You need to read in the COBOL manual about RETURN-CODE. It can only be numbers and be between 0 and 4095. If you set it higher, you will get unexpected results.
Have a good one

venky
Active Member
Posts: 50
Joined: Sat May 12, 2012 10:13 pm

Post by venky » Wed Oct 16, 2013 10:43 pm

Thanks Dikdude,

I have included the code like below.

If file-status-code = 0
move 8 to return-code
else
move 0 to return-code
end-if.

here,when I am submitting the job I am getting Maxcc=8 it depends upon the input file.

Now, my question is instead of 8 or 0, can we pass alphabetic data into any other parameter like we are passing numeric data into return-code, I know return-code will not accept alphabetic data.

my requirement is to pass alphabatic data and need to pass data like 'data is not matching' and need to display this data after job completion.

let me know if ther is any procedure.

Regards,
Venky.

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Wed Oct 16, 2013 11:44 pm

Sure, you can write the apha info to a file and read it for presentation later.
Have a good one

User avatar
Gurugars
Active Member
Posts: 107
Joined: Sat Oct 23, 2010 2:17 pm
Location: Chennai,India.

Post by Gurugars » Thu Oct 17, 2013 10:41 am

my requirement is to pass alphabatic data and need to pass data like 'data is not matching' and need to display this data after job completion
Where you want to disply this message? SYSOUT or somewhere else?
Message in the same step or on some other steps?
Guru:-)

You're never fully dressed without a smile :)

venky
Active Member
Posts: 50
Joined: Sat May 12, 2012 10:13 pm

Post by venky » Thu Oct 17, 2013 11:06 am

Hi Guru,

No I don't want in sysout, in sysout if we want to display we can use 'Display' in the program.

When we run any program we will be seeing the message like maxcc=0 after completing the job right?

Below that maxcc=0 message only I need to dispaly 'data is not matching'.

can we do this?

Thanks.
Regards,
Venky.

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Thu Oct 17, 2013 5:38 pm

I would very much doubt that you could do that. Certainly you could not do it without a modification to the operating system and or JES subsystem.
Regards
Nic

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Thu Oct 17, 2013 8:08 pm

I think venky wants to see a message from the program on the response in his session from the NOTIFY on the JOB statement (hence the reference to MAXXCC).

There is no way to do this directly.

Why do you want to do it? If we know, we might be able to suggest something.

venky
Active Member
Posts: 50
Joined: Sat May 12, 2012 10:13 pm

Post by venky » Thu Oct 17, 2013 10:03 pm

Hi William,

Exactly you are right!

Actually I am writing a program like if a dataset is empty I am sending Maxcc=8 and If a dataset is having data in it then I am sending Maxcc=0 by using return-code. Please look into the below code.

If file-status-code = 0
move 8 to return-code
else
move 0 to return-code
end-if.

Now, I want is after maxcc i need to display some message.

for example: if the dataset is empty I am getting maxcc=8 ,after maxcc=8 i need to display like 'there are no records in the file'.

Thanks.
Regards,
Venky.

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Thu Oct 17, 2013 11:18 pm

OK, but why do you need it?

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Fri Oct 18, 2013 5:49 am

If you want a message generated for one or the other condition code, conditionally execute a step that will print the message you want to generate based on that condition code.

Suggest you forget about MAXCC.
Have a good one

academyindia4

Topic deleted by Admin

Post by academyindia4 » Fri Jan 15, 2016 8:56 pm

<< Content deleted By Admin >>

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others