e.g. Field2 in input file has value -1234567.56 in PD format, the field2 in o/p file should show the value as '-1234567.56'.
I tried the EDIT option in OUTREC, but ended up in SOC7 abend. Also, didn't get much help after searching the forum too.
Can anybody help with this? Thanks. _________________ Regards,
Mangsk
The Field2 of output file has to be X(11) as it will contain :
1 byte sign
7 byte number before decimal point
1 byte decimal point
2 byte number after decimal point
======================
11 byte character _________________ Priya Ranjan Mohanty
Consultant
Kanbay Software (I) pvt. Ltd.
Hyderabad
Joined: 20 May 2004 Posts: 97 Topics: 43 Location: hyderabad, India
Posted: Tue Apr 04, 2006 3:13 am Post subject:
Hi mangsk,
Did you tried the above SORT ....
I had tested it , its working fine.
Check , what you had given for the datatype of Field2 in OUTREC , if you had given ZD , then you will end up with S0C 7 , it should be PD. _________________ Priya Ranjan Mohanty
Consultant
Kanbay Software (I) pvt. Ltd.
Hyderabad
Thanks pzmohanty for your replies.
I apologize for the mistake. Here is my input file fields structure. Please note that the field2 datatype is COMP and not COMP-3 -
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Tue Apr 04, 2006 4:56 am Post subject:
Mangsk,
PD Stands for Packed Decimal - which is equivalent of cobol COMP-3 variable. A field in cobol with a declaration of COMP refers to a Binary variable. So, you should actually use BI instead of PD. Change your sort card as shown below.
for information on equivalent Sort formats for various COBOL data types, see the "What are the equivalent DFSORT formats for various COBOL data types?" Ask Professor Sort item at:
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Apr 04, 2006 10:30 am Post subject:
Mangsk,
Just a few minor comments on your control statements.
The minimum value for a 4-byte FI field is -2147483648 and the maximum value is 2147483647. In each case, that's 10 digits, so your EDIT pattern of SIIIIIIIT with only 8 digits is not the best choice as digits and the sign may be lost. I'd suggest the following instead:
Note that you could use DFSORT's M25 edit mask to do the same thing:
Code:
OUTREC FIELDS=(1,6,7,4,FI,M25,LENGTH=11)
_________________ 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
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