Thread View: bit.listserv.tsorexx
5 messages
5 total messages
Started by Trimble, John
Thu, 09 May 2013 17:02
Need assistance with converting Assembler code to Rexx
Author: Trimble, John
Date: Thu, 09 May 2013 17:02
Date: Thu, 09 May 2013 17:02
25 lines
2105 bytes
2105 bytes
I have an assembler program I am converting to Rexx that issues the following:
SP LASTEXDT,=P'1' SUBTRACT 1 DAY
Against a field defined like this:
LASTEXDT DS PL8
This is packed Decimal data.
How would I go about doing the same thing in Rexx?
John Trimble, CISSP
Information Security Technical Architect
Corporate Security
Fishers, IN
317-806-0269
john.trimble@salliemae.com
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX
Re: Need assistance with converting Assembler code to Rexx
Author: Paul Gilmartin
Date: Thu, 09 May 2013 17:17
Date: Thu, 09 May 2013 17:17
29 lines
2306 bytes
2306 bytes
On 2013-05-09, at 11:02, Trimble, John wrote: > I have an assembler program I am converting to Rexx that issues the following: > > SP LASTEXDT,=P'1' SUBTRACT 1 DAY > > Against a field defined like this: > > LASTEXDT DS PL8 > > This is packed Decimal data. > > How would I go about doing the same thing in Rexx? > Rexx's only numeric data type is decimal display. You can use the c2x() builtin to convert packed decimal to decimal display. Sort of. You need some special tweaking to handle the last nybble which represents the sign. It's almost but not quite entirely unlike UNPK. If you need to, reverse the process using x2c(), after fixing the sign. -- gil ---------------------------------------------------------------------- For TSO-REXX subscribe / signoff / archive access instructions, send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX
Re: Need assistance with converting Assembler code to Rexx
Author: Bill Ashton
Date: Thu, 09 May 2013 17:30
Date: Thu, 09 May 2013 17:30
62 lines
3147 bytes
3147 bytes
Here is a simple Packed to Decimal routine I have called (I call it P2D) that will work with standard definitions: /* REXX */ hex = C2X(Arg(1)); result = Left(hex,Length(hex)-1); If Right(hex,1) = 'D' Then Return '-'result; Else Return result; and then to go back from decimal to packed (yep, called D2P), using only C and D nibbles: /* Rexx decimal to packed */ arg dec If dec < 0 then s = 'D'; else s = 'C' n = space(translate(dec,,'+-.')s,0) Return X2C(right(n,length(n)+length(n)//2,'0')) Billy On Thu, May 9, 2013 at 1:16 PM, Paul Gilmartin <PaulGBoulder@aim.com> wrote: > On 2013-05-09, at 11:02, Trimble, John wrote: > > > I have an assembler program I am converting to Rexx that issues the > following: > > > > SP LASTEXDT,=P'1' SUBTRACT 1 DAY > > > > Against a field defined like this: > > > > LASTEXDT DS PL8 > > > > This is packed Decimal data. > > > > How would I go about doing the same thing in Rexx? > > > Rexx's only numeric data type is decimal display. You > can use the c2x() builtin to convert packed decimal > to decimal display. Sort of. You need some special > tweaking to handle the last nybble which represents > the sign. It's almost but not quite entirely unlike > UNPK. > > If you need to, reverse the process using x2c(), > after fixing the sign. > > -- gil > > ---------------------------------------------------------------------- > For TSO-REXX subscribe / signoff / archive access instructions, > send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX > -- Thank you and best regards, *Billy Ashton* ---------------------------------------------------------------------- For TSO-REXX subscribe / signoff / archive access instructions, send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX
Re: Need assistance with converting Assembler code to Rexx
Author: Trimble, John
Date: Thu, 09 May 2013 17:54
Date: Thu, 09 May 2013 17:54
82 lines
4231 bytes
4231 bytes
Thanks, just what I needed. John Trimble, CISSP Information Security Technical Architect Corporate Security Fishers, IN 317-806-0269 john.trimble@salliemae.com -----Original Message----- From: TSO REXX Discussion List [mailto:TSO-REXX@vm.marist.edu] On Behalf Of Bill Ashton Sent: Thursday, May 09, 2013 1:31 PM To: TSO-REXX@vm.marist.edu Subject: Re: [TSO-REXX] Need assistance with converting Assembler code to Rexx Here is a simple Packed to Decimal routine I have called (I call it P2D) that will work with standard definitions: /* REXX */ hex = C2X(Arg(1)); result = Left(hex,Length(hex)-1); If Right(hex,1) = 'D' Then Return '-'result; Else Return result; and then to go back from decimal to packed (yep, called D2P), using only C and D nibbles: /* Rexx decimal to packed */ arg dec If dec < 0 then s = 'D'; else s = 'C' n = space(translate(dec,,'+-.')s,0) Return X2C(right(n,length(n)+length(n)//2,'0')) Billy On Thu, May 9, 2013 at 1:16 PM, Paul Gilmartin <PaulGBoulder@aim.com> wrote: > On 2013-05-09, at 11:02, Trimble, John wrote: > > > I have an assembler program I am converting to Rexx that issues the > following: > > > > SP LASTEXDT,=P'1' SUBTRACT 1 DAY > > > > Against a field defined like this: > > > > LASTEXDT DS PL8 > > > > This is packed Decimal data. > > > > How would I go about doing the same thing in Rexx? > > > Rexx's only numeric data type is decimal display. You can use the > c2x() builtin to convert packed decimal to decimal display. Sort of. > You need some special tweaking to handle the last nybble which > represents the sign. It's almost but not quite entirely unlike UNPK. > > If you need to, reverse the process using x2c(), after fixing the > sign. > > -- gil > > ---------------------------------------------------------------------- > For TSO-REXX subscribe / signoff / archive access instructions, send > email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX > -- Thank you and best regards, *Billy Ashton* ---------------------------------------------------------------------- For TSO-REXX subscribe / signoff / archive access instructions, send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX This E-Mail has been scanned for viruses. ---------------------------------------------------------------------- For TSO-REXX subscribe / signoff / archive access instructions, send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX
Re: Need assistance with converting Assembler code to Rexx
Author: Itschak Mugzach
Date: Thu, 09 May 2013 17:59
Date: Thu, 09 May 2013 17:59
101 lines
4820 bytes
4820 bytes
Bill showed you the way to do PD to ZONE conversion. You can go back from ZONE to PD after the math. invovled. ITschak On Thu, May 9, 2013 at 7:52 PM, Trimble, John <john.trimble@salliemae.com>wrote: > Thanks, just what I needed. > > > > > John Trimble, CISSP > Information Security Technical Architect > Corporate Security > Fishers, IN > 317-806-0269 > john.trimble@salliemae.com > > > -----Original Message----- > From: TSO REXX Discussion List [mailto:TSO-REXX@vm.marist.edu] On Behalf > Of Bill Ashton > Sent: Thursday, May 09, 2013 1:31 PM > To: TSO-REXX@vm.marist.edu > Subject: Re: [TSO-REXX] Need assistance with converting Assembler code to > Rexx > > Here is a simple Packed to Decimal routine I have called (I call it P2D) > that will work with standard definitions: > /* REXX */ > hex = C2X(Arg(1)); > result = Left(hex,Length(hex)-1); > If Right(hex,1) = 'D' Then Return '-'result; Else Return result; > > and then to go back from decimal to packed (yep, called D2P), using only C > and D nibbles: > /* Rexx decimal to packed */ > arg dec > If dec < 0 then s = 'D'; else s = 'C' > n = space(translate(dec,,'+-.')s,0) > Return X2C(right(n,length(n)+length(n)//2,'0')) > > Billy > > > > On Thu, May 9, 2013 at 1:16 PM, Paul Gilmartin <PaulGBoulder@aim.com> > wrote: > > > On 2013-05-09, at 11:02, Trimble, John wrote: > > > > > I have an assembler program I am converting to Rexx that issues the > > following: > > > > > > SP LASTEXDT,=P'1' SUBTRACT 1 DAY > > > > > > Against a field defined like this: > > > > > > LASTEXDT DS PL8 > > > > > > This is packed Decimal data. > > > > > > How would I go about doing the same thing in Rexx? > > > > > Rexx's only numeric data type is decimal display. You can use the > > c2x() builtin to convert packed decimal to decimal display. Sort of. > > You need some special tweaking to handle the last nybble which > > represents the sign. It's almost but not quite entirely unlike UNPK. > > > > If you need to, reverse the process using x2c(), after fixing the > > sign. > > > > -- gil > > > > ---------------------------------------------------------------------- > > For TSO-REXX subscribe / signoff / archive access instructions, send > > email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX > > > > > > -- > Thank you and best regards, > *Billy Ashton* > > ---------------------------------------------------------------------- > For TSO-REXX subscribe / signoff / archive access instructions, send email > to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX > > This E-Mail has been scanned for viruses. > > ---------------------------------------------------------------------- > For TSO-REXX subscribe / signoff / archive access instructions, > send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX > ---------------------------------------------------------------------- For TSO-REXX subscribe / signoff / archive access instructions, send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads