How to convert unsigned comp-3 to numeric value



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

How to convert unsigned comp-3 to numeric value

Postby ssgan » Tue Mar 05, 2013 6:39 pm

How to convert unsigned comp-3 to numeric value?
i.e. 9(6) comp-3 to 9(6).

I tried with the following sort, it gave the S0C7 abend.

SORT FIELDS=COPY
OUTREC FIELDS=(47,4,PD,EDIT=(TTTTTT))
ssgan
 
Posts: 4
Joined: Mon Mar 04, 2013 5:16 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to convert unsigned comp-3 to numeric value

 

Re: How to convert unsigned comp-3 to numeric value

Postby BillyBoyo » Tue Mar 05, 2013 6:45 pm

Well, that should work if 47 is the correct starting position of your field. Is you file VB? Did you take account of the RDW, by adding four to the start position, giving 51?

Otherwise, show a few lines of your input data, with HEX ON, in the Code tags please.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: How to convert unsigned comp-3 to numeric value

Postby ssgan » Tue Mar 05, 2013 7:07 pm

its FB file only.
You do not have the required permissions to view the files attached to this post.
ssgan
 
Posts: 4
Joined: Mon Mar 04, 2013 5:16 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to convert unsigned comp-3 to numeric value

Postby BillyBoyo » Tue Mar 05, 2013 7:58 pm

  OPTION COPY
  INCLUDE COND=(47,4,PD,NE,NUM)


Run a step containg just this and your intput dataset. Specify an output dataset in the JCL. This will list all records with invalid numeric data in that field. Once you understand what contains the invalid data, you can do something about it.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: How to convert unsigned comp-3 to numeric value

Postby skolusu » Tue Mar 05, 2013 11:34 pm

ssgan wrote:its FB file only.


Well the value you show at 47 for 4 bytes is a valid value. X'0991113F' . So there must be some other invalid record that is causing the S0C7. I suggest you run ICETOOL's VERIFY operator against the Data and you will know exactly which records are having the invalid data. I am only listing the first 100 . However you can change the limit(n) value. n can be 1 to 15 decimal digits, but must be greater than 0.

//STEP0100 EXEC PGM=ICETOOL               
//TOOLMSG  DD SYSOUT=*                     
//DFSMSG   DD SYSOUT=*                     
//IN       DD DISP=SHR,DSN=YOUR Input File
//OUT      DD SYSOUT=*                     
//TOOLIN   DD *                           
  VERIFY FROM(IN) ON(47,4,PD) LIMIT(100)   
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: How to convert unsigned comp-3 to numeric value

Postby BillyBoyo » Wed Mar 06, 2013 12:05 am

ssgan, I've just realised you are showing one record, which is line 15 of your file. Are the previous 14 records not of the same type?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post