IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Converted Unsigned Field to Signed Field


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jr3011

New User


Joined: 17 Apr 2008
Posts: 26
Location: Oviedo, FL

PostPosted: Thu Feb 16, 2012 6:56 pm
Reply with quote

Hi, i am trying to convertd an unsigned field 9(6) position 46 to a signed field s9(6) using the ifthen and overlay. The result of what i have below does not place a sign in the field. Your help would be appreciated.
The hex values of my input and output are the same (input field=000014)
Code:
input             output
F F F F F F       F F F F F C
0 0 0 0 1 4       0 0 0 0 1 4



Code:
SORT FIELDS=(COPY)                                                 
INREC IFTHEN=(WHEN=(23,1,CH,EQ,C'5'),                               
              OVERLAY=(46:46,6,ZD,MUL,+1,TO=ZD,LENGTH=6),HIT=NEXT) 
OUTFIL FILES=1,LRECL=381,REMOVECC,                                 
       OUTREC=(1:1,61,                                             
              90:62,49,                                             
             160:111,165,                                           
             325:276,40,                                           
             365:C' ',                                             
             366:316,16)
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Feb 16, 2012 7:37 pm
Reply with quote

Consulting the manual (link at the top of the page) rapidly reveals a ZDC which has "C" for positive and "D" for negative. You don't need the multiplication, just the TO=ZDC, from reading, but I haven't tried it - something exciting for you to do....
Back to top
View user's profile Send private message
jr3011

New User


Joined: 17 Apr 2008
Posts: 26
Location: Oviedo, FL

PostPosted: Thu Feb 16, 2012 7:42 pm
Reply with quote

Worked perfectly as you predicted.. Thanks alot for your help !
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts Join 2 files according to one key field. JCL & VSAM 3
Search our Forums:

Back to Top