Page 1 of 1

How to display month in cobol.

PostPosted: Wed May 07, 2014 10:58 am
by thia_88
Hi all,

I need your help in this cobol stuff since im new to this language.
Does any of you know the possible way to display 24 months in a row without using current date system or using value clause like (JANFEBMAR...)
Is there any other better option to make it?
Lets say if I want to display from Jan13 Feb13 up to Dec14. :!: :?:

Thanks.

Re: How to display month in cobol.

PostPosted: Wed May 07, 2014 11:27 am
by enrico-sorichetti
and ...
how does the topic relate to the forum rules ???

to make the most out of the questions You ask
You should start by posting to the proper forum section!

Re: How to display month in cobol.

PostPosted: Wed May 07, 2014 11:39 am
by BillyBoyo
Not sure what you feel is so bad about using "JANFEBMAR...". Perhaps you could explain?

Re: How to display month in cobol.

PostPosted: Wed May 07, 2014 11:48 am
by thia_88
Hi BillyBoyo,

My assignment is to display
a. weekly income for the past 24 months.

What if i get assignment to display 36months??

and i use hardcore way to display it using value clause in below.
01 MONTH1-LIST.
15 MONTH1-NAME PIC X(150)
VALUE 'Jan13 Feb13 Mar13 Apr13 May13 Jun13 Jul13 Aug13 Sep13 Oct13 Nov13 Dec13 Jan14 Feb14 Mar14 Apr14 May14 Jun14 Jul14 Aug14 Sep14 Oct14 Nov14 Dec14 '.

But i want something to look professional
any suggestion?

Thanks,
Thia

Re: How to display month in cobol.

PostPosted: Wed May 07, 2014 12:12 pm
by BillyBoyo
You posted an unclear question in the wrong forum. We spend our time here out of the goodness of our hearts. We don't want to waste that goodness by untangling what you have done all the time.

Replying like you did to forum members is not going to improve your chances of getting something useful. Why should that matter? This is a professional forum, where you should use your professional skills.

You have just walked into a meeting, entered a stationery cupboard and left a message that you'd like to write, but without using a pencil or pen.

When your failings were pointed out to you, in whatever way (you will find all kinds of ways in your career), you blamed the messenger.

You need to improve your professional skills and your "inter-personal skills", as well as your computing ones.

Re: How to display month in cobol.

PostPosted: Wed May 07, 2014 12:20 pm
by BillyBoyo
If you PM me, thia_88, to let me know you are good-to-go now, I can clean up this topic further, and we can concentrate on your actual question.

Re: How to display month in cobol.

PostPosted: Wed May 07, 2014 1:26 pm
by Aki88
Thia,

[RANT ON]

1. That last post was uncalled for.
2. The people here are very senior, and there is a fat chance that few of them have hardcore technical experince double your current age; so kindly, show some respect.
3. What Enrico/Billy had tried to point out was that you had originally posted your question in the wrong part of the forum, and that a user is expected to read the rules before making a post; they weren't trying to be rude.
4. Also, they'd mentioned that your question was not put across clearly enough to receive an answer; so please explain your query a tad bit more so that we can help you here.

Lastly, before you make another inflammatory post; read the above notes; re-read; think again; post your mainframe related query and someone will pitch in for help.
Once again, let me put it across for you -- the people you are calling perverts, are people whose work exp itself would be double your age; show some respect please.

[/RANT OFF]

And as far as 'Horrible Forum' part is concerned, there are thousands of user and maybe tons more who have been visiting this and the sister forum for ages, for help/learning something new; so please be happy with your opinion in your world; you're not going anywhere with that attitude.

Regards.

Re: How to display month in cobol.

PostPosted: Wed May 07, 2014 1:47 pm
by Aki88
[Following on the last post]

thia_88 wrote:01 MONTH1-LIST.
15 MONTH1-NAME PIC X(150)
VALUE 'Jan13 Feb13 Mar13 Apr13 May13 Jun13 Jul13 Aug13 Sep13 Oct13 Nov13 Dec13 Jan14 Feb14 Mar14 Apr14 May14 Jun14 Jul14 Aug14 Sep14 Oct14 Nov14 Dec14 '.


If that is how you want the months to be displayed; probably the most beginner level method of doing it (other than what you've already coded in your value clause) is by preparing a layout; here is a sample:

01  MONTH1-NAME.                                       
    03 MONTH1                   PIC X(05) VALUE 'JAN13'.
    03 FILLER                   PIC X(1)  VALUE ' '.   
    03 MONTH2                   PIC X(05) VALUE 'FEB13'.
    03 FILLER                   PIC X(1)  VALUE ' '.   
    03 MONTH3                   PIC X(05) VALUE 'MAR13'.
    03 FILLER                   PIC X(1)  VALUE ' '.   
    03 MONTH4                   PIC X(05) VALUE 'APR13'.
    03 FILLER                   PIC X(1)  VALUE ' '.   
    03 MONTH5                   PIC X(05) VALUE 'MAY13'.
    03 FILLER                   PIC X(1)  VALUE ' '.   
..............and so on; ending with a FILLER with remaining bits of your total length.


and then display it in the procedure division of your program.

Syntax:
DISPLAY <Variable name>.

Note: This is a downright elementary solution; and yes, there are other ways of achieving the result; look at the COBOL manuals from IBM Manuals link at the top of the page for other ways.

Regards.

Re: How to display month in cobol.

PostPosted: Wed May 07, 2014 1:51 pm
by thia_88
Hi Aki88,

Im sorry for being rude and thanks for everything.
And please no advice again..

Thanks,
Thia