MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Converting decimal point to implicit decimal point

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
cobcurious
Beginner


Joined: 04 Oct 2003
Posts: 68
Topics: 25

PostPosted: Tue May 01, 2007 12:29 pm    Post subject: Converting decimal point to implicit decimal point Reply with quote

Hi,

I am receiving an input file with a decimal point (example: -1.1) . I am reading this file in my COBOL program. The field into which the data,received with decimal point, is being stored is declared as numeric with implicit decimal point (say field1 PIC S9V9 COMP) and other there is other field declared as (say field2 PIC S99V9 COMP-3) into which another decimal number,from the input file, is being tried to store. Can someone please let me know how can I convert the decimal numbers into implicit decimal numbers ?

I have searched the forum, I can across something called SFF and UFF. I am not clear how to apply it.

Your help is appreciated.
Thanks
Cobcurious
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Tue May 01, 2007 12:44 pm    Post subject: Reply with quote

cobcurious,

you can use sff format to convert the values

Code:

p,m,SFF,BI,LENGTH=2
p,m,SFF,pd,LENGTH=2

p = start position of the numeric field
m = length of the numeric filed , in here it is 4
bi = comp or binary fileds
pd = packed decimal or comp-3
length = length of the target field , in here it is 2


Hope this helps...

Cheers

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue May 01, 2007 2:50 pm    Post subject: Reply with quote

For complete details on DFSORT's UFF and SFF formats, see my paper at:

www.ibm.com/servers/storage/support/software/sort/mvs/pdug/
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed May 02, 2007 3:24 am    Post subject: Reply with quote

Or read the data into a DISPLAY field then move to your COMP field as per the COBOL Programmers Guide section 3.3.3.4 from the manuals link above.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
cobcurious
Beginner


Joined: 04 Oct 2003
Posts: 68
Topics: 25

PostPosted: Tue May 08, 2007 1:51 pm    Post subject: Reply with quote

Hi All,

Thanks everyone for the help. It worked !

Thanks
Cobcurious
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group