Editor Commands

Posted on February 8, 2017

Ctrl ]         Insert ]  value mark

Ctrl \         Insert \ subvalue mark

BI = Equivalent to the Universe ‘FORMAT’

0001 Esc            Go to Command->

0001 Ctrl X         Exit

0001 Ctrl A         Move to start of current line

0001 Ctrl E         Move to end of current line

0001 Ctrl W         Delete word

0001 Ctrl K         Clear to end of line.

0001 Ctrl DD        Delete current line

0001 Ctrl G         Mark block.

0001 Ctrl L         Insert line below current line

0001 Ctrl N         Locate next occurrence

0001 Ctrl O         Toggle overwrite and insert.

0001 Ctrl T         Mirror character above

0001 Ctrl V         Indent for BASIC

0001 Ctrl ]         Insert ]  value mark

0001 Ctrl \         Insert \ subvalue mark

Command->ex         Exit

Command->exk        Exit key. Do not load list items

Command->FI         Save and exit

Command->FS         Save

Command->FD         Delete record

Command->nn         Go to line nn

Command->L string   Locate “string”

Command->/string    Locate “string string”

Command->CAn        Copy Marked block after current line, n times

Command->CBn        Copy Marked block before current line, n times

Command->MAn        Move Marked block after current line, n times

Command->MBn        Move Marked block after current line, n times

Command->DEn        Delete line after current line. n times

Command->R/a/b/n    Change a to b on current line. n times

Command->RU/a/b     Change all a to b on current line.

Command->R9/a/b     Change a to b on 9 lines from current.

Command->BI         Format BASIC code

Command->BION       Turn on Format indentation

Command->S?         Display record size

Command->! Cmd      Execute command

Command->!!         Re-execute last ! Cmd

Command->HEX        Toggle the display in Hexadecimal

 

jsh command

Globus>ls           Execute unix cmd excluded pipe, redirection, wildcards characters

Globus>env          Display environment setting unix

Globus>Row up       Command stack  Get previous command

Globus>Ctrl e       Command stack  Move to end of line

Globus>Ctrl a       Command stack  Move to beginning of line

Globus>ESEARCH      Search string in records

 

jsh command for administration

Globus>jdiag           Display environment setting jbase

Globus>jshow           Show catalog

Globus>jstat -?        Analyse file sizing

Globus>jrf -?          Resize file

Globus>where (V        Display process details

Globus>show-item-locks Display locks

Globus>logoff Portno   Logoff user

Remove characters from the end of a string or number and append others

Posted on September 3, 2015

Convert 1234.4569.3 to 1234.4569.1

PQN
MV %3 “1234.4569.3”
T %3
MV %4 %3:G2.1
T %4
IF %4 > “1” MV %4 “1”
T %4
MV %5 %3:G0.2
T %5
T C%5,%5,”.1″

Display a column with a name other than the DICT attribute name.

Posted on March 6, 2015

LIST RMIM PRICE > “100” DISPLAY.NAME “Price Greater then 100”

Including the length (characters) of a field in a LIST

Posted on March 6, 2015

LIST RMIM EVAL “SUBR(‘-LENS’,DESC1)” DESC1

DESC1 is the DICT attribute.

RMIM……………. 2087
SUBR(“-LENS”,DESC1). 27
DESC1…………… GCA8040 BLACK 1-1/2″ X 200′

RMIM……………. 3187S
SUBR(“-LENS”,DESC1). 36
DESC1…………… *17177*FLLA-WINGED:#5747-9*0110*5747

RMIM……………. 285753
SUBR(“-LENS”,DESC1). 59
DESC1…………… AX1G-1-30-91-WCA, RENU CONVERTER FROM WCA WITHOUT TOP STENT

Sort Data by Week Number

Posted on April 16, 2014

Sort Data by Week Number

There are times when doing reports when you need to sort your values into weeks.
Most people would end up writing a program to do this, but that is not necessary.

So assuming attribute 14 contains a date, then

F Correlative
F;14;C7;/
A Correlative
A;(14 / “7”)

A full dictionary item would like the like the following
WEEK.NBR
001 S
002 0
003 Week Number
008 F;14;C1;+;C7;/
009 R
010 6

WEEK.NBR is now the week number since 1968, with Sunday as the start of the week. You can then
use this in a BREAK-ON.

SORT FILE BY DATE BREAK-ON WEEK.NBR

If you want to have Monday as the beginning of the week, then do the follow:

WEEK.NBR.M-S
001 S
002 0
003 Week Number
008 F;14;C1;-;C7;/
009 R
010 6

If you want to sort based on the week number within the year, use:

WEEK.NBR.IN-YR
001 S
002 0
003 Week Number
008 A;(14 / “7”)-((“01/01/”:(14(DY)))(DI) / ”7”)
009 R
010 6

Credit to Tom Phillips.

DICT attribute ‘9’ isn’t only used for column justification!

Posted on April 15, 2014

Watch out for records that mix alpha and numeric characters in the same field. If a field takes a value which is expected and used as numeric but for whatever reason it’s append and stored with alpha chars.

For example: In the file SALES the value of attribute LOT-NO is always numeric but in the file RETURNS the value of attribute LOT-NO has alpha characters are appended.

JQL searches records based on the justification specified in DICT attribute 9.  Specifying ‘R’ searches right to left. Specifying ‘L’ searches left to right. Additionally ‘R’ will align right and ‘L’ will align left when displayed and/or printed.

Example: in the file named RETURNS

If the value of LOT-NO is 123456.1(1234) it will not be located when DICT LOT-NO specifies attribute 9 as R. JQL will look at LOT-NO starting on the right which begins with ‘)’ and not on the left which begins with ‘1’

SELECT RETURNS WITH LOT-NO = “123456]” – You might think this record, which begins with 123456, would be returned using ‘]’. However because attribute 9 specifies R it will not.

DICT RETURNS

LOT-NO

0001 A
0002 1
0003 Lot Number
0004
0005
0006
0007
0008
0009 R
0010 15

If the value of LOT-NO is 123456.1(1234) it will be located if DICT LOT-NO specifies attribute 9 as L. JQL will look at LOT-NO starting on the left which begins with ‘1’ and not on the right which begins with ‘)’

SELECT RETURNS WITH LOT-NO = “123456]” – As you would expect, because this record begins with 123456 it will be returned using the ‘]’ because attribute 9 specifies L.

DICT RETURNS

LOT-NO

0001 A
0002 1
0003 Lot Number
0004
0005
0006
0007
0008
0009 L
0010 15

Surprise!

 

 

Temenos Documentation on GitHub

Posted on November 16, 2013

https://github.com/begoon/temenos-documentation

Show Me The Money – jBASE Decimals and OCONV/ICONV

Posted on July 9, 2013

Credit: Kevin King, Precision Solutions – Article from International Spectrum

For eons, MultiValue programmers have used the “MR2” and “MD2” conversions for formatting money values. While this conversion is perfect for converting a stored money amount to something human-readable — for those of us with a decimal currency, that is — there are a surprising number of developers unaware that this code can do much more.

Whether formatting a money, decimal, date, time, alphanumeric, or other type of value, all of the conversion features of the MultiValue platform are worthy of continued study. In UniData, conversion codes are documented with the ICONV(..) and OCONV(..) functions in the BASIC Reference, but with conversions being a crucial feature of dictionaries and the query language you may find more information about conversions just about anywhere in a documentation bundle.

Today let’s take a brief glance at the “MR2” conversion code. Years ago it was explained to me that the “M” and “R” mean “mask” and “right justified” and the following “2” means “show two decimal places”. While accurate, it missed a very important detail: There’s a digit missing!

The “MR” conversion code — as well as its kissing cousin “MD” (Mask Decimal) and even “ML” (Mask Left) — can be followed by two separate number parameters. The first number is the number of decimals to show, and the second is the number of positions to scale (move) the decimal point. For example, a conversion of “MR2” is really an abbreviation of “MR22”, which means to show two decimal points after scaling the decimal by two positions. Similarly “MD4” will show four decimal places after scaling the number by four decimal places. (In an OCONV the decimal moves to the left; in an ICONV the decimal moves to the right.)

So what’s the big deal? If not typing that second digit saves you a keystroke and it just works, why should you care? On the other hand, what if you want to show a certain number of decimals but scale the number differently?

Let’s say for instance we’re building a report program that’s reading a list of payment amounts from a text file. As we look at the text file we instantly notice that the payment amounts are unpredictably formatted, like this:

23
5.2
325.46
6432.236

To output these on our report we need to convert these values so that each payment amount has two decimal places, no more, no less. Throughout the years I’ve seen a number of ways to achieve this in code, the most common being to input convert the raw value by two decimal places, and then output convert that result by two decimals, like this:

VALUE = OCONV(ICONV(IN.VALUE,’MR2′),’MR2′)

While this does the trick, wouldn’t it be cool if we could do it all with a single conversion? With separate show and scale numbers in our “MR” conversion, we can do exactly that:

VALUE = OCONV(IN.VALUE,’MR20′)

In this example, the “MR20” says to mask the number, right justified (though the justification doesn’t matter, see sidebar), show two decimal places, but scale the decimal by zero places. In other words, the decimal won’t move and we’ll still get our two decimal places in the human-readable output.

Looking at this from a different perspective, what if we want to take a number that is stored with two decimal places and show it in thousands with no decimal places? For our example, let’s say the stored value is “12345678” which represents “123456.78”. For our report, we want to show this value simply as 123. We certainly could OCONV the input value using the “MR5” conversion to format the number as “123.45678” and then use an “MR0” conversion to scale this to “123”, but why do it with two conversions when we can do it with a single “MR05”?

While this is just one of many options available with of the MR, MD, and ML conversion codes, it’s a significant detail that can simplify the transformation of numbers from one base and format to another in a single operation. There are many other options for adding commas, dollar signs, asterisks, and padding, so if you’re interested, dig into the manual and see all that these conversion codes have to offer.

Did You Know?

As an output conversion, MR2, ML2, and MD2 are nearly, if not entirely, identical depending on the MultiValue platform in use. The justification code (R, L, or D) means nothing unless the number has fill and width parameters, such as MR2%10 or ML2#10, where the “%” represents “fill with zeroes” and the “#” represents “fill with spaces,” both in a field of 10 characters.

# # #          # # #          # # #

 

 

FMT

Posted on June 4, 2013

Here’s a simple list but it also shows how you can dictate the column width using FMT, 30 is the column width which is always followed by #, T forces the output to text. Text is always left justified.

LIST DICT RMIM D/CODE A/AMC V/CONV FMT”15#T”  V/CORR FMT”30#T”  V/TYPE V/MAX WITH D/CODE “A]” “X]” “U]” “S]” “D]” “V]” “I]” “M]” “PH]” BY A/AMC BY D/CODE

You can also use “R#2” which is right justified in a field two characters wide and “L#2″ which is left justified in a field two characters wide. You can substitute the 2 with any number. R and L works best with numeric fields. You can use it with any attribute type but the output isn’t reliable.

LIST DICT RMIM D/CODE A/AMC FMT”R#2″ V/CONV FMT”15#T”  V/CORR FMT”30#T”  V/TYPE V/MAX WITH D/CODE “A]” “X]” “U]” “S]” “D]” “V]” “I]” “M]” “PH]” BY A/AMC BY D/CODE

LISTDICT RMIM or LISTDICTS RMIM will do basically the same thing. I didn’t lookup ‘LISTDICTS’ to find the difference between the two verions.

New Post

Posted on April 15, 2013

Right Here