Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Correct way to define a numeric field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
sungang77

New User


Joined: 03 Nov 2005
Posts: 46
Location: Shanghai, China

PostPosted: Mon Nov 21, 2005 4:29 pm    Post subject: Correct way to define a numeric field
Reply with quote

Which one of the following is the correct way to define a field to contain the value +123.45?
a. 05 W-NUMBER PIC S9(03)V99.
or
b. 05 W-NUMBER PIC +999.99.
Back to top
View user's profile Send private message

Ramya A

Active User


Joined: 26 Jul 2004
Posts: 104

PostPosted: Tue Nov 22, 2005 1:52 am    Post subject: Re: Correct way to define a numeric field
Reply with quote

Hi

There is no correct way and wrong way for defining those variables...there are actually different ways out of which you have to choose the one you need depending on the PURPOSE.

Eg:
If you are using the variable only for display/reporting purpose, then second method would suite.
If the variable will be involved in calculations, then first method should be used.

Regards,
Ramya
Back to top
View user's profile Send private message
sungang77

New User


Joined: 03 Nov 2005
Posts: 46
Location: Shanghai, China

PostPosted: Tue Nov 22, 2005 7:19 am    Post subject: Re: Correct way to define a numeric field
Reply with quote

Ramya Arun wrote:
Hi

There is no correct way and wrong way for defining those variables...there are actually different ways out of which you have to choose the one you need depending on the PURPOSE.

Eg:
If you are using the variable only for display/reporting purpose, then second method would suite.
If the variable will be involved in calculations, then first method should be used.

Regards,
Ramya

It's a question from Brainbench test, there are 5 choices for it. I am confused with the 2 choices I mentioned here.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Tue Nov 22, 2005 10:30 am    Post subject: INITIALIZE
Reply with quote

hi frnd,
According to me from the below choices

a. 05 W-NUMBER PIC S9(03)V99.
or
b. 05 W-NUMBER PIC +999.99.

choice B will do. check it. let me know.
Back to top
View user's profile Send private message
sungang77

New User


Joined: 03 Nov 2005
Posts: 46
Location: Shanghai, China

PostPosted: Tue Nov 22, 2005 11:34 am    Post subject: Re: INITIALIZE
Reply with quote

khamarutheen wrote:
hi frnd,
According to me from the below choices

a. 05 W-NUMBER PIC S9(03)V99.
or
b. 05 W-NUMBER PIC +999.99.

choice B will do. check it. let me know.


How to check it on Brainbench...I don't know, khamarutheen.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Tue Nov 22, 2005 11:57 am    Post subject: numeric field
Reply with quote

hi frnd,
i doesn't mean to check out with brainbench. i mean that to check out with ur cobol compiler. k. any way u have a practise test in that. try out with that. it gives u only few questions and also with solution. try out. Regarding ur choice now i m confused lot. bcz +999.99 is a wrong declaration. its a receiving pic clause not specification. so choice a will do i think so but at the same time if V99 is specified it will take as 12345 not as 123.45 .. so this is the confusion. plz b patient. let any one say the right solution. i too waiting for that.
Back to top
View user's profile Send private message
sungang77

New User


Joined: 03 Nov 2005
Posts: 46
Location: Shanghai, China

PostPosted: Tue Nov 22, 2005 12:16 pm    Post subject: Re: numeric field
Reply with quote

khamarutheen wrote:
hi frnd,
i doesn't mean to check out with brainbench. i mean that to check out with ur cobol compiler. k. any way u have a practise test in that. try out with that. it gives u only few questions and also with solution. try out. Regarding ur choice now i m confused lot. bcz +999.99 is a wrong declaration. its a receiving pic clause not specification. so choice a will do i think so but at the same time if V99 is specified it will take as 12345 not as 123.45 .. so this is the confusion. plz b patient. let any one say the right solution. i too waiting for that.

Hi khamarutheen,
I am sorry to tell you I haven't COBOL compiler now. I can only send to my friend to test it. Wait for me.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Is the explanation correct? XRST,CHKP Martylin IMS DB/DC 1 Wed Mar 15, 2017 9:26 am
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us