Conversion to octal
Bruin, J.M. de
Bruin@WT.TNO.NL
Wed, 29 Oct 2003 22:02:44 +0100
Sorry for the earlier post. This was sent unintentionally and thus too soon.
Here the complete version.
For a maximum of 134217727 (decimal i.e. 77777777 octal) you could use this:
Temp t'zu10NUMBER Zoned Unsigned Size 10
Temp t'c8OCTAL Character Size 8
Temp t'n1OCTAL8 Numeric*1
Temp t'n1OCTAL7 Numeric*1
Temp t'n1OCTAL6 Numeric*1
Temp t'n1OCTAL5 Numeric*1
Temp t'n1OCTAL4 Numeric*1
Temp t'n1OCTAL3 Numeric*1
Temp t'n1OCTAL2 Numeric*1
Temp t'n1OCTAL1 Numeric*1
Temp t'n1OCTAL0 Numeric*1
Temp t'zu10NUMBER8 Zoned Unsigned Size 10
Temp t'zu10NUMBER7 Zoned Unsigned Size 10
Temp t'zu10NUMBER6 Zoned Unsigned Size 10
Temp t'zu10NUMBER5 Zoned Unsigned Size 10
Temp t'zu10NUMBER4 Zoned Unsigned Size 10
Temp t'zu10NUMBER3 Zoned Unsigned Size 10
Temp t'zu10NUMBER2 Zoned Unsigned Size 10
Temp t'zu10NUMBER1 Zoned Unsigned Size 10
Temp t'zu10NUMBER0 Zoned Unsigned Size 10
Item t'zu10NUMBER = 134217727 (the max value as an example)
Item t'n1OCTAL8 = Floor(t'zu10NUMBER / (8^8))
Item t'zu10NUMBER8 = t'zu10NUMBER - t'n1OCTAL8 * (8^8)
Item t'n1OCTAL7 = Floor(t'zu10NUMBER8 / (8^7))
Item t'zu10NUMBER7 = t'zu10NUMBER8 - t'n1OCTAL7 * (8^7)
Item t'n1OCTAL6 = Floor(t'zu10NUMBER7 / (8^6))
Item t'zu10NUMBER6 = t'zu10NUMBER7 - t'n1OCTAL7 * (8^6)
Item t'n1OCTAL5 = Floor(t'zu10NUMBER6 / (8^5))
Item t'zu10NUMBER5 = t'zu10NUMBER6 - t'n1OCTAL7 * (8^5)
Item t'n1OCTAL4 = Floor(t'zu10NUMBER5 / (8^4))
Item t'zu10NUMBER4 = t'zu10NUMBER5 - t'n1OCTAL7 * (8^4)
Item t'n1OCTAL3 = Floor(t'zu10NUMBER4 / (8^3))
Item t'zu10NUMBER3 = t'zu10NUMBER4 - t'n1OCTAL7 * (8^3)
Item t'n1OCTAL2 = Floor(t'zu10NUMBER3 / (8^2))
Item t'zu10NUMBER2 = t'zu10NUMBER3 - t'n1OCTAL7 * (8^2)
Item t'n1OCTAL1 = Floor(t'zu10NUMBER2 / (8^1))
Item t'zu10NUMBER1 = t'zu10NUMBER2 - t'n1OCTAL7 * (8^1)
Item t'n1OCTAL0 = Floor(t'zu10NUMBER1 / (8^0))
Item t'zu10NUMBER0 = t'zu10NUMBER1 - t'n1OCTAL7 * (8^0)
Item t'c8OCTAL &
= Ascii(t'n1OCTAL8) &
+ Ascii(t'n1OCTAL7) &
+ Ascii(t'n1OCTAL6) &
+ Ascii(t'n1OCTAL5) &
+ Ascii(t'n1OCTAL4) &
+ Ascii(t'n1OCTAL3) &
+ Ascii(t'n1OCTAL2) &
+ Ascii(t'n1OCTAL1) &
+ Ascii(t'n1OCTAL0)
Mark
---------------------------------------------------------------------------
Mark de Bruin Voice : +31 15 269 69 05
TNO Automotive Fax : +31 15 257 21 04
Crash Services Laboratories GSM : +31 653 44 2145
ICT Services E-mail:bruin'at'wt.tno.nl
Room: GBS 1.1 URL
:http://www.automotive.tno.nl/
P.O. Box 6033 http://www.tno.nl/
2600 JA Delft
The Netherlands
This e-mail message including any attachment(s), is intended solely for
the addressee or addressees and is strictly confidential or otherwise
legally protected. Any views or opinions presented herein are solely
those of the author and do not necessarily represent those of TNO.
For information about this disclaimer and TNO Automotive, follow this
link http://www.automotive.tno.nl/smartsite.dws?id=886
> -----Original Message-----
> From: Mike Palandri [mailto:palandri@4j.lane.edu]
> Sent: Wednesday, October 29, 2003 19:12
> To: powerh-l@lists.swau.edu
> Subject: Re: Conversion to octal
>
>
> It's all in QTP. It's not really account creation per se,
> but a master
> file that stores VMS user names and UICs for student email
> accounts, thus
> the need to create the UIC numbers. All students that have a
> record in the
> file; a subset actually get or have accounts.
>
> When a teacher authorizes a student for email, they use a web based
> interface that pulls the student data from the file and
> creates the account
> via DCL.
>
>
> At 05:06 PM 10/29/2003 +0000, Chris Sharman wrote:
> >Mike Palandri wrote:
> >>Hi all,
> >>Anyone have a ready made piece of qtp code to convert a
> positive (base
> >>10) integer to octal?
> >
> >Presumably you're writing dcl to do this (account creation) ?
> >(I wouldn't mess with sysuaf any other way)
> >
> >How about: 'f$fao("!%I",<number>)'
> >
> >Chris
> >
> >
> >
> >-------------------------------------------------------------
> ----------
> >
> >Any views expressed in this message are those of the sender and not
> >necessarily those of CCA Group. The unauthorized use, disclosure,
> >copying or alteration of this message is forbidden. The contents of
> >this message may be confidential and/or privileged,
> copyright CCA Group
> >and are intended solely for the use of the individual or
> entity to whom
> >they are addressed. Whilst this message has been scanned, CCA Group
> >cannot guarantee that it is virus free or compatible with
> your systems
> >and accepts no responsibility for any loss or damage arising from its
> >use. The recipient is advised to run their own anti-virus
> software. If
> >you receive this message in error please contact
> >postmaster@ccagroup.co.uk immediately, destroy any copies
> and delete it
> >from your computer systems.
> >= = = = = = = = = = = = = = = = = = = = = = = = = = = =
> >Mailing list: powerh-l@lists.swau.edu
> >Subscribe: "subscribe" in message body to
> powerh-l-request@lists.swau.edu
> >Unsubscribe: "unsubscribe <password>" in message body to
> >powerh-l-request@lists.swau.edu
> >http://lists.swau.edu/mailman/listinfo/powerh-l
> >This list is closed, thus to post to the list you must be a
> subscriber.
>
>
> Mike
> .
>
> = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> Mailing list: powerh-l@lists.swau.edu
> Subscribe: "subscribe" in message body to
> powerh-l-request@lists.swau.edu
> Unsubscribe: "unsubscribe <password>" in message body to
> powerh-l-request@lists.swau.edu
> http://lists.swau.edu/mailman/listinfo/powerh-l
> This list is closed, thus to post to the list you must be a
> subscriber.
>