Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
ragin

New User

Joined: 20 Feb 2005
Posts: 16

 Posted: Thu Mar 31, 2005 9:05 am    Post subject: How to calculate total no of Bytes Hi frndz, I need the following o/p with calculation of how to calculate the total no of bytess in the following: 01 rec1 . 02 a pic x(6). 02 b redefines a. 03 c occurs 6 times pic 9. 02 d occurs 4 times. 03 e pic x(5). 03 f pic 999. Answer: a)38. b)44 c)14 d)32 Now i need to know how to calculate total no of bytess in the above prog.i need it with calculation.kindly update me ASAP.

gorle_n4

New User

Joined: 11 Mar 2005
Posts: 8

 Posted: Thu Mar 31, 2005 11:45 am    Post subject: Re: How to calculate total no of Bytes 01 rec1 . 02 a pic x(6). 02 b redefines a. 03 c occurs 6 times pic 9. 02 d occurs 4 times. 03 e pic x(5). 03 f pic 999. here b is a redefining a so same memory will be shared so there it is occupying only 6 bytes c is a group element and d is an elementary item of c. (6+4=10) e=5 f=3 6+10+5+3=24 so answer is 24 Answer: a)38. b)44 c)14 d)32
learnmf

Active User

Joined: 14 Mar 2005
Posts: 123

Posted: Thu Mar 31, 2005 1:18 pm    Post subject:

 Quote: Hi frndz, I need the following o/p with calculation of how to calculate the total no of bytess in the following: 01 rec1 . 02 a pic x(6). 02 b redefines a. 03 c occurs 6 times pic 9. 02 d occurs 4 times. 03 e pic x(5). 03 f pic 999.

hi friend the answer is 38.
A and b sharessame space.It is 6.

Dcontains 8*4=32
heceit is 38

New User

Joined: 08 Mar 2005
Posts: 54
Location: Chennai

 Posted: Thu Mar 31, 2005 7:06 pm    Post subject: hai friend the answer is 38 here we go how it happened 01rec1 . 02 a pic x(6). 02 b redefines a. 03 c occurs 6 times pic 9. 02 d occurs 4 times. 03 e pic x(5). 03 f pic 999 6 + 4 * 5 + 4 * 3 = 44 . since b redefines a they share same space
satyanarayana.chitneni

New User

Joined: 28 Mar 2005
Posts: 4

 Posted: Fri Apr 01, 2005 1:50 pm    Post subject: How to calculate total no of Bytes Hi friends, rsshanmugam is right .
satyanarayana.chitneni

New User

Joined: 28 Mar 2005
Posts: 4

 Posted: Fri Apr 01, 2005 2:08 pm    Post subject: How to calculate total no of Bytes Hi, Let me know where the 'c' will be stored? 'b' redefines 'a' means both variables adress is same, additional space(additional elementary items of 'b') of 'b' will be appended to space of 'a'. So i hope 44 is the right answer. Please give me clear answer whether i am right or not. Regards, Satya
learnmf

Active User

Joined: 14 Mar 2005
Posts: 123

Posted: Fri Apr 15, 2005 8:13 pm    Post subject:

 Quote: Hi, Let me know where the 'c' will be stored? 'b' redefines 'a' means both variables adress is same, additional space(additional elementary items of 'b') of 'b' will be appended to space of 'a'. So i hope 44 is the right answer. Please give me clear answer whether i am right or not. Regards, Satya

HI Satya Where u find aditional space.
maverick05

New User

Joined: 14 Apr 2005
Posts: 54
Location: Earth

 Posted: Sat Apr 16, 2005 9:41 pm    Post subject: Re: How to calculate total no of Bytes Hi Satya, You have mentioned 6 + 4 * 5 + 4 * 3 = 44 . But i think 6 + 4 * 5 + 4 * 3 = 38. Just check the calculation.Correct me i am wrong as i'm weak in maths
mmwife

Super Moderator

Joined: 30 May 2003
Posts: 1592

 Posted: Sun Apr 17, 2005 8:50 pm    Post subject: HI Satya, The 6 occurences of the 1 byte c occupy the same space as the 6 byte a. BTW guys, to avoid confusion, it's best to use parens "()" when showing arith, e.g.: 6 + ( 4 * 5) + (4 * 3) = 38 or more closely describing the record layout: (1)6 + ( 5 + 3)4 = 38 the numbers within the parens rpresent the lengths of each elementary item; the numbers outside the parens represent the occurs.
Chandukc

New User

Joined: 25 Apr 2005
Posts: 2

 Posted: Mon Apr 25, 2005 12:30 pm    Post subject: Shanmuga is correct Shanmugam is correct,but the equation he has given is wrong I think.Coorect me if I'm wrong.
ovreddy

Active User

Joined: 06 Dec 2004
Posts: 211
Location: Keane Inc., Minneapolis USA.

 Posted: Tue Apr 26, 2005 2:55 pm    Post subject: Hi, 01 rec1 . 02 a pic x(6). (6 Bytes)+ 02 b redefines a. (same memory so 0)+ 03 c occurs 6 times pic 9. (same memory child so 0)+ 02 d occurs 4 times. (4*8=32 total child length)+ 03 e pic x(5). (5) 03 f pic 999. (3) So 38 is the answer... Tip: You can use Calculator to calculate the length. Thanks, Reddy.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Error in SQL-PLIST3 'Above value tru... rikdeb DB2 4 Wed Sep 06, 2017 1:34 pm Wanted to calculate TRK when i have B... Balu5491 JCL & VSAM 10 Wed Jul 19, 2017 5:43 pm DSNACCOX (can it be run on 1 db/ts, t... SRICOBSAS DB2 5 Sat May 06, 2017 12:59 am How to calculate an specific transact... lind sh CICS 2 Tue Sep 13, 2016 9:20 pm Calculate a timeframe with DFsort Gerd Hofmans DFSORT/ICETOOL 6 Thu Jan 14, 2016 5:30 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us