How to display month in cobol.



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

How to display month in cobol.

Postby thia_88 » Wed May 07, 2014 10:58 am

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.
thia_88
 
Posts: 12
Joined: Wed May 07, 2014 8:48 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to display month in cobol.

Postby enrico-sorichetti » Wed May 07, 2014 11:27 am

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!
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: How to display month in cobol.

Postby BillyBoyo » Wed May 07, 2014 11:39 am

Not sure what you feel is so bad about using "JANFEBMAR...". Perhaps you could explain?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How to display month in cobol.

Postby thia_88 » Wed May 07, 2014 11:48 am

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
thia_88
 
Posts: 12
Joined: Wed May 07, 2014 8:48 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to display month in cobol.

Postby BillyBoyo » Wed May 07, 2014 12:12 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How to display month in cobol.

Postby BillyBoyo » Wed May 07, 2014 12:20 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How to display month in cobol.

Postby Aki88 » Wed May 07, 2014 1:26 pm

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.
Aki88
 
Posts: 381
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 36 times

Re: How to display month in cobol.

Postby Aki88 » Wed May 07, 2014 1:47 pm

[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.
Aki88
 
Posts: 381
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 36 times

Re: How to display month in cobol.

Postby thia_88 » Wed May 07, 2014 1:51 pm

Hi Aki88,

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

Thanks,
Thia
thia_88
 
Posts: 12
Joined: Wed May 07, 2014 8:48 am
Has thanked: 0 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post