View previous topic :: View next topic
|
Author |
Message |
crm
New User
Joined: 14 Nov 2005 Posts: 25
|
|
|
|
HAI
LET ME KNOW ANSWER FOR THIS SMALL PROGRAM:
01 A
02 B PIC A(2)
02 C PIC X(2)
02 D PIC 9V9
02 E PIC X/X
02 F PIC $9.99
02 G PIC X(2)
01 M PIC 9V9 VALUE IS '1.2'
01 N PIC X(2) VALUE IS '12'
INITIALIZE A. |
|
Back to top |
|
|
iknow
Active User
Joined: 22 Aug 2005 Posts: 411 Location: Colarado, US
|
|
|
|
Hi crm,
To your question I found out that using cobol-85 it doesn't recognise "INITIALIZE A". So i used "MOVE spaces to A". The output being generated is spaces.
If anyone comes with a solutuion, please add on. |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
hi frnd,
INITIALIZE is functionally equal to one or more MOVE statements. in ur case
>>>SPACES will be moved to the B,C,E,G and
>>>ZERO for D,F
i think so. let me know if any other solutions.. |
|
Back to top |
|
|
sungang77
New User
Joined: 03 Nov 2005 Posts: 46 Location: Shanghai, China
|
|
|
|
khamarutheen wrote: |
hi frnd,
INITIALIZE is functionally equal to one or more MOVE statements. in ur case
>>>SPACES will be moved to the B,C,E,G and
>>>ZERO for D,F
i think so. let me know if any other solutions.. |
Hi khamarutheen,
I agree with you in B, C, D, E, G. But I'm wondering whether the INITIALIZE to F--a formatted numeric data, it will be spaces or zeros, I'm not sure... |
|
Back to top |
|
|
sungang77
New User
Joined: 03 Nov 2005 Posts: 46 Location: Shanghai, China
|
|
|
|
Hi khamarutheen,
You are right. The F will be ZEORS after INITIALIZE. |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
hi frnd,
In general the INITIALIZE statement sets selected categories of data fields to predetermined values. so
For alphabetic,alphanumeric,alphanumeric-edited items it moves SPACE
For numeric and numeric-edited items it moves ZERO
Remember this words.. then u will not get any confusions. |
|
Back to top |
|
|
sungang77
New User
Joined: 03 Nov 2005 Posts: 46 Location: Shanghai, China
|
|
|
|
khamarutheen wrote: |
hi frnd,
In general the INITIALIZE statement sets selected categories of data fields to predetermined values. so
For alphabetic,alphanumeric,alphanumeric-edited items it moves SPACE
For numeric and numeric-edited items it moves ZERO
Remember this words.. then u will not get any confusions. |
Get it.
Thank you very much, khamarutheen. |
|
Back to top |
|
|
|