View previous topic :: View next topic |
Author |
Message |
warp5 Intermediate

Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Mon Jan 06, 2003 7:39 am Post subject: Really simple rexx tool |
|
|
The rexx called rexi (rexx interpreter)
Code: |
/* Rexx rexi rexx command-interpreter */
arg cmdline
interpret say cmdline
exit
And here are examples of its use:
Example: Result:
REXI 100*9%5+32 212 Change C (100) to F (212)
REXI (212-32)*5%9 100 Change F (212) to C (100)
REXI 555+666 1221
REXI c2d('81'x) 129 Character to Decimal
'nnnn'x = Hexadecimal
REXI c2x('72s') 'F7F2A2' Character to Hexadecimal
REXI c2x('0123'x) '0123' Character to Hexadecimal
REXI date(b)//7 0 - 6 0 Monday, 6 Sunday
REXI date(d) 130 Days so far this year
REXI date(e) dd/mm/yy European date
REXI date(j) yyddd Julian date
REXI date(m) January Month
REXI date(n) default dd mon yyyy Normal
REXI date(o) yy/mm/dd Ordered (suitable for sorting)
REXI date(s) yyyymmdd Sorted (suitable for sorting)
REXI date(u) mm/dd/yy USA
REXI date(w) Tuesday Weekday
REXI d2c(129) '81'x Decimal to Character
REXI d2x(129) '81' Decimal to Hexadecimal
REXI time(e) ssssss.uuuu Elapsed
REXI time(h) hh Hours
REXI time(l) hh.mm.ss.uuu Long
REXI time(m) mmmm Minutes since midnight
REXI time(s) sssss Minutes since midnight
REXI x2c('F') '0F'x Hexadecimal to Character
REXI x2d('0F') 15 Hexadecimal to Decimal
REXI d2x(x2d(100a)+x2d(2002) 300c Hexadecimal Addition
|
|
|
Back to top |
|
 |
sudhtech Beginner
Joined: 27 Mar 2003 Posts: 6 Topics: 2 Location: Chennai
|
Posted: Thu Mar 27, 2003 9:32 am Post subject: |
|
|
Hi,
Can you please let me know how to run these commands ?
Thanks! _________________ Sudheer Nelluri |
|
Back to top |
|
 |
Manas Biswal Intermediate

Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Thu Mar 27, 2003 11:38 pm Post subject: |
|
|
wow, I don't mind saying that this is sort of a magic routine. What does this interpret actually do?. And how come it can perform so many functions?
Regards,
Manas |
|
Back to top |
|
 |
warp5 Intermediate

Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Fri Mar 28, 2003 2:12 am Post subject: |
|
|
Sure took you guys a long time to discover this!
Sudhtech, store the Rexi procedure in a library where you can run rexx with. Then just type in rexi and the function you want to use.
Manas Biswal, the interpret just lets you use the input as a command. The interpret is often used to construct a rexx command that has variables as part of the command. Take a look at the manuals on it. |
|
Back to top |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Fri Mar 28, 2003 2:20 am Post subject: |
|
|
There are many languages where you give variable commands (using some Macros) but they get resolved during compilation. But with REXX (and CLIST) you can even vary commands at run time.
Is it because these are interpreter languages?!
Diba. |
|
Back to top |
|
 |
jacky_ying Beginner
Joined: 25 Jul 2004 Posts: 46 Topics: 20
|
Posted: Mon Aug 23, 2004 8:22 am Post subject: |
|
|
useful and interesting tool,thanks |
|
Back to top |
|
 |
PRABHAKARP Beginner

Joined: 27 Aug 2004 Posts: 1 Topics: 0 Location: india
|
Posted: Fri Aug 27, 2004 1:02 am Post subject: |
|
|
Hi warp5,
How the above rexi macro will execute.I am trying to execut the rexi commands ,but it says invalid command.plz let me know how to exexute? _________________ Thanks,
Prabhakar |
|
Back to top |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Fri Aug 27, 2004 10:22 am Post subject: |
|
|
Prabhakarp,
This might help you,
http://www.mvsforums.com/helpboards/viewtopic.php?t=2287
Also, I would like to know from which library you are executing the tool ? Is that concatenated to your SYSEXEC ? Else, copy the REXI macro to ur default SYSEXEC PDS and try executing from there or concatenate the library which has REXI macro to ur SYSEXEC.
Thanks,
Phantom |
|
Back to top |
|
 |
|
|