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 Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts INREC PARSING and dictionary items migusd SYNCSORT 6 Fri Jun 02, 2017 8:02 pm
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm

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