Converting decimal point to implicit decimal point
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Utilities

#1: Converting decimal point to implicit decimal point Author: cobcurious PostPosted: Tue May 01, 2007 12:29 pm
    —
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

#2:  Author: kolusuLocation: San Jose PostPosted: Tue May 01, 2007 12:44 pm
    —
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

#3:  Author: Frank YaegerLocation: San Jose PostPosted: Tue May 01, 2007 2:50 pm
    —
For complete details on DFSORT's UFF and SFF formats, see my paper at:

www.ibm.com/servers/storage/support/software/sort/mvs/pdug/

#4:  Author: Nic CloustonLocation: At Home PostPosted: Wed May 02, 2007 3:24 am
    —
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.

#5:  Author: cobcurious PostPosted: Tue May 08, 2007 1:51 pm
    —
Hi All,

Thanks everyone for the help. It worked !

Thanks
Cobcurious



MVSFORUMS.com -> Utilities


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group