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
 

 

one question about table.

 
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: Tue Nov 22, 2005 8:26 am    Post subject: one question about table.
Reply with quote

Code:
01 TABLES.
  05 T-DATA-TABLE.
     10 T-DATA-ENTRIES OCCURS 60 TIMES.
        15 T-DATA-FIELD         PIC S9(04)V99.

S0100-PROCESS.
 MOVE 1  TO W-PRODUCT
 PERFORM S0200-CALC-PROD
    VARYING W-SUB1 FROM 2 BY 2
        UNTIL W-SUB1 > 60
 END-PERFORM.

S0200-CALC-PROD.
  MULTIPLY T-DATA-FIELD(W-SUB1) BY W-PRODUCT.

Question:Review the table definition and sample code above. The code is used to find the product of the even-numbered elements in the table. Which one of the following defines the Working Storage fields needed in this process?
Choice 1
Code:
01 WORK-AREAS.
                       05  W-PRODUCT     PIC S9(08)V99.
                       05  W-SUB1        PIC 9(02).

Choice 2
Code:
01 WORK-AREAS.
                       05  W-PRODUCT     PIC S9(08) VALUE 1.
                       05  W-SUB1        PIC 9(02) VALUE 0.

Choice 3
Code:
01 WORK-AREAS.
                       05  W-PRODUCT     PIC S9(04)V99 VALUE 0.
                       05  W-SUB1        PIC 9(03).

Choice 4
Code:
01 WORK-AREAS.
                       05  W-PRODUCT     PIC 9(04)V99.
                       05  W-SUB1        PIC X(02).

Choice 5
Code:
01 WORK-AREAS.
                       05  W-PRODUCT     PIC S9(06)V99.
                       05  W-SUB1        PIC 9(01).
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 8:31 am    Post subject: Another question about table.
Reply with quote

Five product numbers (plane)
Ten sizes (rows)
Four different prices based on package color (columns)
per product

Each element should be defined with a picture clause of PIC 9(05)V99.

Question:Which one of the following shows the data division necessary to define a table, T-PRODUCT-TABLE, using the table data shown above?
Choice 1
Code:
05  T-PRODUCT-TABLE.
   10 T-PRODUCT-NUM                     OCCURS 5 TIMES.
      15 T-PRODUCT-SIZE                 OCCURS 10 TIMES.
         20 T-PRICE        PIC 9(05)V99 OCCURS 4 TIMES.

Choice 2
Code:
05  T-PRODUCT-TABLE.
   10 T-PRODUCT-NUM OCCURS 5 TIMES, T-PRODUCT-SIZE
       OCCURS 20 TIMES, T-PRODUCT-PKG OCCURS 4 TIMES.
      15 T-ELEMENT         PIC 9(05)V99.

Choice 3
Code:
05  T-PRODUCT-TABLE.
   10 T-PRODUCT-NUM            OCCURS 5 TIMES.
      15 T-PRODUCT-SIZE        OCCURS 10 TIMES.
         20 T-PRICE        PIC 9(05)V99.

Choice 4
Code:
05  T-PRODUCT-TABLE.
   10 T-PRODUCT-NUM            OCCURS 5 TIMES.
   10 T-PRODUCT-SIZE           OCCURS 10 TIMES.
   10 T-PRODUCT-PKG            OCCURS 4 TIMES.   
      15 T-PRODUCT-PRICE   PIC 9(05)V99.

Choice 5
Code:
05  T-PRODUCT-TABLE              OCCURS 5 TIMES.
   10 T-PRODUCT-NUM             OCCURS 10 TIMES.
      15 T-PRODUCT-SIZE         OCCURS 4 TIMES.
         20 T-PRODUCT-PKG  PIC 9(05)V99.
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:15 am    Post subject: Table
Reply with quote

hi frnd,
Plz post the questions seperately. i thought its the solution and viewing. no probs. for the first Question Choice 2 will do. since the multiplication is whole number. it will do. check it.
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:17 am    Post subject: Table
Reply with quote

hi frnd,
For the second question i was confused. since base level cannot contain the OCCUR class. so depending on that scenario i prefer choice 1 will work. 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:30 am    Post subject: Re: Table
Reply with quote

khamarutheen wrote:
hi frnd,
Plz post the questions seperately. i thought its the solution and viewing. no probs. for the first Question Choice 2 will do. since the multiplication is whole number. it will do. check it.


Hi khamarutheen,
Acctually I don't know clearly what the 1st question means. What means "the product of the even-numbered element"? And in your explaination, "since the multiplication is whole number", what this sentence mean?
I choose 1.
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:36 am    Post subject: Table
Reply with quote

hi frnd,
Choice 1 also has the posibility. let us work out and c. i mean that since there is no decimal value manipulation then why do v use V99 so i prefer the choice 2..
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:42 am    Post subject: Re: Table
Reply with quote

khamarutheen wrote:
hi frnd,
Choice 1 also has the posibility. let us work out and c. i mean that since there is no decimal value manipulation then why do v use V99 so i prefer the choice 2..

Hi khamarutheen,
Why you say there is no decimal value in the manipulation?
Code:
T-DATA-FIELD         PIC S9(04)V99.
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 12:02 pm    Post subject: Table
Reply with quote

hi frnd,
There is no accept statement so by mistake i consider that the above program multiply with the no. generated by loop which increments by 2 . sorry yar. ur answer choice 1 is right. Thanks for correcting mesungang77.
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:11 pm    Post subject: Re: Table
Reply with quote

khamarutheen wrote:
hi frnd,
There is no accept statement so by mistake i consider that the above program multiply with the no. generated by loop which increments by 2 . sorry yar. ur answer choice 1 is right. Thanks for correcting mesungang77.


You are welcome, khamarutheen
How many year have you work on COBOL?
I have worked as a COBOL developer on CICS for about 3 years for bank, and pay too more attention on business than on syntax, so when I now want to find another job, I feel I'm just a beginner of COBOL... Faint...
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 unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am
No new posts The Last Two Question For You To Ask ... CaptBill Mainframe Interview Questions 0 Fri Apr 14, 2017 5:42 am
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts Asynchronous CICS Processing Question moezbud CICS 1 Mon Mar 06, 2017 6:13 pm


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