Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Can we use edited picture clause in comp items?

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

New User


Joined: 26 May 2006
Posts: 5

PostPosted: Fri May 26, 2006 10:59 am    Post subject: Can we use edited picture clause in comp items?
Reply with quote

Hi,
for example,

can we write working section as
01 a pic 9(3).9(2) comp. ------Is it possible?

we can write
01 a1 pic 9(3)v9(2) comp.

my question is
move 345.78 to a
move 345.78 to a1
what is the output of a and a1?
Back to top
View user's profile Send private message

rdr

New User


Joined: 26 May 2006
Posts: 35
Location: india

PostPosted: Fri May 26, 2006 11:04 am    Post subject:
Reply with quote

Hi Kolappan,

I am answering to the later part of the question-
Please let me know if i am wrong....


Quote:
my question is
move 345.78 to a
move 345.78 to a1
what is the output of a and a1?



Out put is 345.78-a
345.78-a1

Regards,
Rohit.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun May 28, 2006 10:46 pm    Post subject:
Reply with quote

A def of a decimal number (regardless of the type - comp, display, comp-3) is separate and distinct from its edited def.

To edit a numeric field you must MOVE it to an edited field or provide a value in the edited def. So there are no COMP (or NUMERIC DISPLAY, for that matter) edited fields, only edited fields.

So, in your example, fld a is invalid and should cause a compiler error. If you recode it as a pic 9(3).9(2) you can move 345.78 to it and it will display as 345.78.

You can also move 345.78 to fld a1 then move field a1 to fld a and fld a will display as 345.78.

Answering your 2nd ques with the new defs:

a1 should contain X'00008712'

If you move it to fld a it should display as 345.78

I haven't tested any of this but it gives you a good foundation to try it for yourself.
Back to top
View user's profile Send private message
kolappan

New User


Joined: 26 May 2006
Posts: 5

PostPosted: Mon May 29, 2006 12:43 pm    Post subject: Thanx
Reply with quote

Hi Mmwife,

Thanx for your kind reply.

Regards,
Kolappan.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue May 30, 2006 3:17 am    Post subject:
Reply with quote

Hi Kolappan,

I hope it's enough to get you started.

I forgot to mention that the editing takes place as a by-product of the data conversion process of function being performed (e.g. MOVE).
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 COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us