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
 

 

redefine will be for space or for values

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
ashokkit

New User


Joined: 22 Apr 2005
Posts: 4

PostPosted: Mon Apr 25, 2005 3:27 pm    Post subject: redefine will be for space or for values
Reply with quote

01 rec1 .
02 a pic 9(3) value 222.
02 b pic 9(2) value 11.
01 rec2 redefines rec1 .
02 c pic 9(4).
02 filler pic x.
??
procedure division.

?????display c.

what is the anwer for this?

[/i]
Back to top
View user's profile Send private message

mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Apr 26, 2005 4:46 am    Post subject:
Reply with quote

Hi,

The ans is 2221
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Wed Apr 27, 2005 11:21 pm    Post subject:
Reply with quote

Hi Ashok!

A small suggestion from me. Why don't you give a simple try with that code, rather than asking us. Experience teaches us many things and even we get a chance to expermient many things with that piece of code right!

Hope you will take my suggestion in a positive sense.
Back to top
View user's profile Send private message
ashokkit

New User


Joined: 22 Apr 2005
Posts: 4

PostPosted: Fri Apr 29, 2005 2:04 pm    Post subject:
Reply with quote

hai thanks alot . i got a little bit of confusion .i thought that redefines will not occupy values but uses the storage space alone . thats y ? i got clarified now .
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Apr 30, 2005 9:40 pm    Post subject:
Reply with quote

Hi Ashok,

I'm not sure I get your point, but I'll explain my understanding:

When you define a group field w/ valued elementary sub-fields they define a string of data. In your example that string is 5 bytes long and contains "22211":

a - 3 bytes long and containing "222".
b - 2 bytes long and containing "11".

When you redefined that 5 byte string you divided it into 2 fields:

A 4 byte field (c) that contained the 1st 4 bytes of the string, "2221".
A 1 byte field (filler) that contained the 5th byte of the string, "1".

HTH
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm


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