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
 

 

Initialization of a fixed decimal field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
sachin_kle

New User


Joined: 19 Dec 2005
Posts: 5
Location: Bangalore

PostPosted: Mon Dec 19, 2005 5:31 pm    Post subject: Initialization of a fixed decimal field
Reply with quote

Hi,

I have a structure with the following declaration:

01 STRUC1,
05 SRI_CREATED CHAR(26),
05 RECEIPT_AMT DEC FIXED(15,2),
05 RECEIPT_AMT DEC FIXED(15,2);

If i initialize
STRUC1 = '';

What will be the values in the character and FIXED DEC field?
Back to top
View user's profile Send private message

parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Tue Dec 20, 2005 2:01 pm    Post subject:
Reply with quote

Hi Sachin,

As far as I know, there is no concept of structure in COBOL ( like in C).

Also, initialization in COBOL can be done with INITIALIZE verb.

there are no data types like CHAR and DEC FIXED

.

As far as your question is concerned, if you initialize a group item, Low values(lowest values in collating sequence) is moved into all the items of the given group item ( structure !) ..


I hope it was helpful.

Please let me know if you need further clarification to this..
Back to top
View user's profile Send private message
muffirulz

New User


Joined: 14 Sep 2005
Posts: 74
Location: Kentucky, USA

PostPosted: Wed Dec 21, 2005 1:11 am    Post subject: Re: Initialization of a fixed decimal field
Reply with quote

hi,
man you are combining cobol and C.
i dont think so there is any command as struct in cobol
as far as initialization is concerend then we can do it by initialize verb
Back to top
View user's profile Send private message
Nanda Krishna

New User


Joined: 30 Nov 2005
Posts: 19
Location: Bangalore

PostPosted: Fri Dec 23, 2005 4:06 pm    Post subject:
Reply with quote

Hey!
The question is related with PL/I, not with Cobol. In PL/I we have the concept of Structures.

Sachin,
As per what i know ... there is no " (double quote) in the PL/I Character sets. So, it will give compilation error when u assign STRUC1 = '' ;
Back to top
View user's profile Send private message
shinjini_t

New User


Joined: 11 May 2005
Posts: 14
Location: Bangalore, India

PostPosted: Wed Dec 28, 2005 11:13 am    Post subject:
Reply with quote

Hi Sachin,

If you initialise STRUC1 = '';
then the CHAR Variable will have hexadecimal blanks and teh FIXED DEC will be populated with hexadecimal zeroes.

Shinjini
Back to top
View user's profile Send private message
ajmalrahman
Warnings : 1

New User


Joined: 10 Jul 2006
Posts: 2

PostPosted: Tue Jan 30, 2007 11:09 am    Post subject: Declaration of Fixed DEC to Fixed BIN.
Reply with quote

what is declaration in FIXED BIN which exactly use the space storage of FIXED DEC(15) , Fixed Dec(9) and vise versa
Back to top
View user's profile Send private message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Mon Mar 26, 2007 8:54 pm    Post subject: Re: Initialization of a fixed decimal field
Reply with quote

Hello ajmalrahman,
UNSIGNED FIXED BIN (64,0) and SIGNED FIXED BIN(63,0) declarations occupy the storage that same as FIXED DEC(15).

When comes to your second question ........
Fixed Dec(9) occupies 5 bytes and you cannot declare any fixed bin variable which occupies 5 bytes..All fixed bin varibles occupy 2,4 or 8 bytes depending up on the precision of the variable..
Back to top
View user's profile Send private message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Mon Mar 26, 2007 8:55 pm    Post subject: Re: Initialization of a fixed decimal field
Reply with quote

Hello ajmalrahman,
UNSIGNED FIXED BIN (64,0) and SIGNED FIXED BIN(63,0) declarations occupy the storage that same as FIXED DEC(15).

When comes to your second question ........
Fixed Dec(9) occupies 5 bytes and you cannot declare any fixed bin variable which occupies 5 bytes..All fixed bin varibles occupy 2,4 or 8 bytes depending up on the precision of the variable..
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 -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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 Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 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