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
 
How to write a S9(7)V99 COMP-3 field into a file

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

New User


Joined: 15 Nov 2005
Posts: 15
Location: chennai

PostPosted: Thu Jan 31, 2008 8:12 pm    Post subject: How to write a S9(7)V99 COMP-3 field into a file
Reply with quote

Hi ,

I have a field S9(7)V99 COMP-3 in a file.when i browse that file the value of thet field is like +64.00 ,-64.00,-2395.00.

I have to write it in output file in the same format taht is like
+64.00 ,-64.00,-2395.00.
Please suggest me a solution.
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Jan 31, 2008 8:31 pm    Post subject: Re: HOW TO WRITE A S9(7)V99 COMP-3 IN TO A FILE?
Reply with quote

krishnakumarramaraj wrote:
Hi ,

I have a field S9(7)V99 COMP-3 in a file.when i browse that file the value of thet field is like +64.00 ,-64.00,-2395.00.

I have to write it in output file in the same format taht is like
+64.00 ,-64.00,-2395.00.
Please suggest me a solution.


Those values are you softwares interpretation of the values not the way they are in the file. if you want COMP-3 values in your file then just define the field as pic s9(7)v99 comp-3 and move the data from the input to the output. If you want like +64.00 ,-64.00,-2395.00 then define it as numeric edited in your output file PIC +,+++,++0.99 and move the data from the input to the output.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Jan 31, 2008 8:35 pm    Post subject:
Reply with quote

a PIC S9(7)V99 COMP-3 field containing +64.00 will be a 5 byte field containing X'000006400C'.

if you want the field in the file to look like +64.00 you need to define 2 edit masks: PIC ++++++9.99 and PIC ------9.99.

based on the positive or negative value of the comp-3 field you need to move to one or the other edit mask. an edit mask will only show - or +. not both (used to be). maybe the new cobols provide a multifunction editmask.

I would suggest defining your editmask in the output file definition.

if you want the file to contain a COMP-3 field, then define the output file definition with a comp-3 field.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jan 31, 2008 11:04 pm    Post subject:
Reply with quote

Hello,

Quote:
when i browse that file the value of thet field is like +64.00 ,-64.00,-2395.00.
How are you browsing the file that shows the sign and the decimal point? "Inside" a file a comp-3 (packed decimal) field would have neither. . .

Are you using a "smart" browse that matches the data to a copybook or something similar?
Back to top
View user's profile Send private message
krishnakumarramaraj

New User


Joined: 15 Nov 2005
Posts: 15
Location: chennai

PostPosted: Mon Feb 04, 2008 10:38 am    Post subject: Hi d.sch,
Reply with quote

Thanks for ur reply and its working.
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 Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm

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