Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Converted Unsigned Field to Signed Field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Converted Unsigned Field to Signed Field
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7255

PostPosted: Thu Feb 16, 2012 7:37 pm    Post subject: Reply to: Converted Unsigned Field to Signed Field
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    Post subject: Reply to: Converted Unsigned Field to Signed Field
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us