jr3011
New User
Joined: 17 Apr 2008 Posts: 26 Location: Oviedo, FL
|
|
|
|
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) |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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.... |
|