UniData Development Notes

                                                                           UniData Development Notes
U2 Best Practice
Subroutine U2Central(FunctionToCall,Action,InData,OutData,ErrText)



…could lookup up Function to see what interface it has then either

Call @FunctionToCall(Action,InData,OutData,ErrText)

Call @FunctionToCall(InData,OutData,ErrText)

Call @FunctionToCall(InData,OutData)





Infoflo Development Standard
Before make any changes in Infoflo, following the standard procedures below,
  1. Use COMPARE command to check if the BP Program or Process in DEV.DATA that is about to be changed is identical with the version in live account, i.e. ACCT.DATA
  2. If it is identical, then make a copy of the program in the format as ProgramName.JUNTAN.SAVE.mmddyyyy, otherwise report to Gervais for the inconsistence.
  3. Check if there exist previous copies by other programmer and do the purging accordingly. (in case of deleting, make sure the object code, catalog and voc entry are deleted also. Do not use DELETE directly to delete a program but using SELECT -> OS.ED instead, also never use DELETE.FILE because it will caused the entire file entry, namely, the directory to be deleted. Use DELETE.CATALOG to remove a catalog, this will also delete the corresponding VOC entry, and it might require more than one time in order to delete the local catalog and the global catalog)
  4. In case of flicking BP program in SRC, make sure to use the COMPARE command to check it with the version in live after the flicking is done and recompile the program as well by using OS.SE -> F8 or OS.AE with option FIBCDF
  5. As a general rule, rollouts into production on Monday & Tuesday after 4pm (EST).
  6. When a new file or a new field is introduced, make sure to create or update the corresponding EQU_XXX file by using IPEX.EQUATES tool and inform windows development team as well.
  7. Make sure to clear the test code during development time before requesting to do the rollout!!!
  8. Never ever try to use OS.ED or OS.SE in ACCT.DATA and PREP.DATA account!!!
  9. Sometimes it might need to recompile BP program once it is rolled into PREP.DATA and ACCT.DATA.
  10. In paragraph, when we do a read file, the system will automatically open the file, so no open file command is needed (refer to IECP4010.9 as an example)
  11. In paragraph, it is not allowed to explicitly use ; as string delimiter since it is used in the object source code of the paragraph. An alternative way of overcoming this is to use CHAR(59) to indicate an implicitly using of ;.
Infoflo System Tools
ED Line Editor:
  • FI (or SV or SAVE) -> Save the file
  • FIB -> Save the file and compile
  • FIBCDF -> Save the file, compile and force to generate local catalog in case it already exists
  • FD -> Delete the file
  • EV -> Multi-Value drill down (@VM)
  • ESV -> Multi-Sub-Value drill down (@SVM)
Infoflo How to FAQ?
How to send the output of a UniData command to the printer directly?
  • Any UniData Command + Space + LPTP (ex. SORT BP = “xxxxxx” LPTP)
How to kill a locked Infoflo user session?
  • Login with username TECHSUP, password TECHFISH
  • Following the menu to kill the locked user session(s)
How to print a purchase report in dev environment?
  • PUR4000 to get a purchase order number along with the buyer code
  • SYS3005 -> BYR to get the buyer’s number
  • SYS9030 -> PO + Buyer # to reset the associated printer (or change to another printer) from option HS to HP
  • Call the process to print the report
How to sequentially modify records in a file?
  • Use SELECT or SSELECT to get the key list of a file
  • Use SAVE.LIST to save the active list (list buffer #0)
  • Use GET.LIST to retrieve the key list of a file
  • Use ESEARCH filename to locate certain string in the records of the file
  • Use SE filename to sequentially modify the records (hit ESC to go to the next record)
How to set focus for a field on a screen?
  • Ex. P:(@RTN.FLAG = “{W_DIRECTORY}”) -> set focus point to return  or EXIT {FILED NAME}
How to copy records from one file to another file? (Source file and destination file should have the same structure)
  • Use SELECT statement to save the desired records into the current list
  • Use COPY + SourceFileName
  • When prompted as TO: for destination file, enter ( + destination file name (no space in between)
  • Enter Y when ask if get id’s from select list
How to regenerating driver for a screen?
  • Process name – Main screen process
  • Options – SD
    • S Force Screen Definition to be rebuilt
    • D Force Driver to be rebuilt
    • Transfer Drivers to DOS
    • Quiet mode (no progress messages)
How to generate source code for screen?
  • TM -> Generate Source Code -> Enter the process name of the screen
  • The generated source code will be stored in IIPROGS
SB+ and UniData Miscellaneous
SB+ Reference:
  • GC – Generate Source Code (/GC can be used on TCL to compile paragraph or basic program)
  • MP – Modify Process
  • FD – Field Definition
  • SD – Screen Definition
  • MD – Menu Definition
  • PD.P – Paragraph Definition
  • SBX – Tree view for menu under GUI mode
  • DEBUG – View SB+ common variables
  • COMMON – It will show an interface for common variables like @KEY, @RECORD, @WORK, etc…
  • QUICK – Use this to see full description of project that has been rolled into production already.
  • EE – View the result of any valid SB+ expression
  • EEGC – Prompts for a standard SB+ expression and displays the BASIC code generated by SB+.
  • \ – Clears a field (make it null)
  • / – Allows you to call a process (if permitted by your security level), e.g. /WHO
  • /n – Moves the cursor directly to field n, in the tab order specified for the screen.
  • /n.m – Moves the cursor directly to a value m within a multi-valued field n on a screen, e.g. /0.999 jumps to the last value in the window plus one, with the cursor positioned in the controlling multi-valued field.
  • KEYS display the list of current edit keys. The keys displayed depend on the terminal definition currently in use for the terminal.
  • USER.FLAGS defines the screen refresh mode.
  • Length Of Field – If you wish to prevent data extending beyond the nominated field length, or you want an auto-carriage return when the cursor has reached the field length limit, enter the length as a negative number.
  • Expressions as conversion codes, e.g. (IF (@VALUE > CREDIT.LIMIT,BLINK.ON :@VALUE’MD2’ :BLINK.OFF,@VALUE’MD2’)). BLINK.ON is equated to @TERM.DEFN<3,4> and BLINK.OFF is equated to @TERM.DEFN<4,4>
  • Online Help Document for sub-screen – P:(@PARMS(30)<2,1>=”SYSI9105.1S”) -> put this code in Proc Before Screen under Screen Parameters (F6)  (Has to set the process name back as the main process name i.e SOP6100)
  • Enable Online Help option: F10 Action ACTION -> A10 [H]elp M:SYSHELP2
  • In field definition, if set the length of field to -1, the carriage return will be inserted after the input automatically.
  • KEY”G0*1” – search key with delimiter *, skip 0 and return 1
  • In paragraph, when use READL to lock a record after read, a WRITE or WRITEV command will not automatically release the record lock as it will do in BP program, so we need to explicitly user RELEASE command to release the lock at the end.
  • Convert value from lower case to uppercase in paragraph. (@VALUE = OCONV(@VALUE,’MCU’))
  • @OTHER(17) # ‘’ -> program is run under batch mode, otherwise it is run under TCL.
  • On field definition Screen (F5), press F6 to bring Additional Field Parameter and set the length as desired to override the actual length of the field defined in file dictionary.
  • Use common variable GUI to determine the current terminal mode, i.e. 1 -> GUI Mode and 0 -> CHAR Mode
SB+ Paragraph Syntax:
  • @VALUE = REPL(” “,””,@VALUE) (Trim extra space in the string)
  • EXEC ‘SYS0061,7583\’:SYSTBL_KEY
  • EXEC “DIALOG,xxx” or DISP 4, “xxx”
  • FIELD.ID = @LINE<1,18> (favorite global equates, SB+ Solutions @ page 8-26)
UniBasic Program:
  • Dynamic array xxx<-1> assign the next value in the array and separated by @FM
  • Check record lock and indicate the user who is currently locking the record.
      CALL IILK(KEY,SOHDR,ILC,FLG)                                 
WHILE FLG DO                                                              
      L_USER_LOCK_REC = GETUSERNAME(STATUS())                                
      CALL SB.PROCESS(‘SYS0061,IP2292\’:KEY:@VM:L_USER_LOCK_REC:’\\7′)
How to execute BP command in paragraph and put result in selection list?
  2. L_STMT = ‘S:SSELECT SYSTBL WITH @ID = “I242*]”‘                              
How to execute UniQuey command in paragraph?
  • EXEC ‘>:UniQuery_Command’
    1. sub-screen with read field should have its screen parameters “Write Record (Y/N)” set to ‘N’, otherwise, the system will treat it as a main input screen and the feature for sharing common variables such as @KEY, @WORK, @RECORD, etc. between the main screen and sub-screen will not be applicable anymore. However, if the sub-screen does not have any read field, then the screen parameters “Write Record (Y/N)” should be set to null (no value) for sharing common variables.
    2. Once you create a select list, any subsequent select statement acts against that list. You must delete or deactivate the active select list before retrieving IDs based on completely new criteria.
    3. Trick to synchronize @CNT between parent screen and sub-screen:
      1. Store @CNT on parent screen to work variable @WORK<300> for example.
      2. Set value on Proc Before Screen slot of Screen Parameters to @3 (up arrow), this will initialize @CNT for the multivalue field.
      3. Set @CNT @WORK<300> – 1 and @REFRESH=-2
UniData Reference:
  • LIST BP WITH @ID = “xxx””yyy” (ex. Select all records in file BP that match either “xxx” or “yyy”)
  • ESEARCH.DICT COMO ALL -> Searching for certain string appears in all DICT
  • MATREAD – Reads record and parses the fields into successive elements of a matrix (dimensioned array)
  • MAT array = expression – Set all elements to result of the expression
  • PRC.NAME -> This variable is a LIFO attribute-delimited stack of the processes that have been called. As one process calls another, the new process being called is pushed onto the beginning of the stack, and is popped off when that process terminates.
  • “/R” will refresh the screen when entered at an input prompt or menu.
  • “/DEBUG” will enter into debug mode.
  • “/COMMON” will show an interface for common variables like @KEY, @RECORD, @WORK, etc…
  • LOGIN -> Switch between GUI and CHAR mode
  • LISTU -> Check current login user in the system and from which account
  • LIST.READU -> Check current locked file by whom in the system
  • SORT BP LPTR -> direct query output to the printer specified by the SETPTR command
  • MODIFY filename F15 = “0” WITH F15 = “xxx”” (Change all record match F15 = “xxx” to “x” for filename, better to use SELECT to get a list with those need to be changed, be careful with this command!)
  • CALL SB.PROCESS(“ProcessName,Parameter)
  • SYS0017 -> Use it before calling a selection list process to allow vague search (make sure to start with the input field first when build the selection criteria in the selection list definition)
  • Use CLEARSELECT before to execute a UniQuery (SELECT statement) in BP program because the next SELECT statement will not clear the active list. (EXECUTE “CLEARSELECT” does not work in BP program)
  • User IPEX.EQUATES to build the EQU_XXX program
  • UniData Dynamic Array 3 Level Hierarchy -> DynamicArrayList<@AM,@VM,@SVM>  (e.g. ArrList<1,2,3>)
  • Use SYSTEM(12) to get the internal format of the system local time in milliseconds -> divide by 1000 to get the milliseconds part and use OCONV to get the HH:MM:SS part (i.e. HH:MM:SS.ttt)
UniQuery Reference :
  • As our default setup, our UniData environment is using PICK flavor (ECLTYPE -> 2  U_PSTYLEECL  ON). If a session has been set to ECLTYPE P and a command has been entered in lowercase case (the verb), the UniData (ECLTYPE U) parser is used for that command. For example, retrieve certain field without duplicate value by using UniQuery would be “select FILE WITH @ID LIKE …xxx… SAVING UNIQUE FIELDNAME NO.NULLS
Keyboard Shortcut:
  • Ctrl + P + A       -> copy
  • Ctrl + P + P       -> paste
  • Ctrl + P + U       -> switch to uppercase
  • Ctrl + P + L       -> switch to lowercase
  • Ctrl + P + T       -> switch to first letter capitalized
  • Ctrl + End         -> full line edit
  • Ctrl + W            -> switch between line edit and full screen edit mode when editing paragraph
  • Ctrl + C             -> type ABORT to get in SB+ shell (same as type 0 at Infoflo main menu), then MM (Cancel current process and go back to Infoflo main menu)
Unix Reference:
  • !who | grep userid -> check if a user is currently on the system (if userid is not in full, the system will do a vague search)
  • /backups/COPY_FILES/juntan
  • chmod 777 *
  • ls –l | pg
  • press ESC twice to recall previous used command

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s