Monday, May 21, 2012
   
Text Size

Site Search powered by Ajax

Pick/Basic Lesson 2

T o d a y ' s   D e v e l o pme n t   C h a l l e n g e s  

As a new generation of software products and components is being developed for "real time" and integrated enterprise, Web-based, and service oriented architecture (SOA) implementations, developers are pushing against limitations of the relational paradigm once again. While RDBMS vendors have made enhancements that extend their capabilities beyond the strict limitations of relational data management, the "extended relational" approach is proving to be the right solution for some software vendors that need to manage complex data structures in an "on-demand" world.

PROGRAM FROM LESSON 1

In the first program, many of the most fundamental principles of programming in PICK/BASIC are discussed. Topics, statements, and functions covered include comments (remarks),  OPENPATH, OPEN, SELECT, FOR, LOOP, CONVERT, NUM, END, IF-THEN, STOP, TRIM, WRITE, cALL the null string, and SUBROUTINE CALL. 

PROGRAM NAMES AND COMMENT SECTIONS


 The first LINE is just the name of the Program. Rather than trying to explain the entire program in the program name, it may be more useful to decide on a simple item-id and explain the purpose of the program through remarks in the program. A comment section is simply a standard set of remark statements that appears at the beginning of each program. Remark statements have little effect on the execution of the program. This technique makes it easier to work with program files.

The Program Name

It's usually a good idea to use line 1 of each program to repeat the program name:

001 PROGRAM LOAD.PAYER.CHANGES 

The reason for this is that programs which are considered external subroutines require a SUBROUTINE statement on this line, so you can't always count on this line being available. Note: Instead of placing a remark on line one, it is permissible to put the word "PROGRAM," followed by the program name. This little-known feature has been present for years in the Pick System.


The next twelve lines of Programming lesson 1 consist of comments:"*" infront of a line Stands for a comments or Remarks. The Compiler will ignore that Line. Lines 2 through 13 are self explanatory. It is not necessary to go through a detail explaination.

  1.        PROGRAM LOAD.PAYER.CHANGES
  2. *----
  3. * Name          : Load Payer Changes
  4. * Description   : Read Text File and Load TBLPAYER Table
  5. * Notes         : This program reads a comma delimited textfile and Loads The TBLPAYER Table
  6. * Author        : Eltas Code Snippet
  7. * Called By     : N/A
  8. *---- Notes
  9. * =====
  10. *----
  11. * Syntax76-010138
  12. *---- Modification History
  13. *---- 02/22/2008        Creation Date

  

THE Flat FILE LOCATION 

Line 14 Defines a windows Path where the Text file will be found. This File  

   14.  TEXTFILE = "D:\IBM\UV\accounts\insappdev\textdata\"

INITIALIZE VARIABLES
Line 15 initializes the variable SUCCESS TO null

   15.   SUCCESS = ''


   16.   OPENPATH TEXTFILE TO ITEXT ELSE
   17.       SUCCESS = STATUS()
   18.      SUCCESS = SUCCESS:" Path ":TEXTFILE:" Not Found"
   19.       CRT SUCCESS

THE STOP STATEMENT

 

The STOP statement immediately terminates the execution of a program:
   20.      STOP

THE END STATEMENT


The END Statement ends the ELSE Statement A Condition Path that would be taken If the Windows Path did not exist on the computer and thus the OPENPATH Statement would Fail

   21.   END

   22.     OPEN 'TBLPAYER' TO PAYER ELSE
   23.         SUCCESS = STATUS()
   24.         SUCCESS = SUCCESS:" Unable to open TBLPAYER"
   25.         RETURN
   26.      END
 The above Code Snippet will open the Table Defined as TBLPAYER Holding Payer Records
   27.      OPEN 'TBLCLAIMUSERS' TO USERS ELSE
   28.         SUCCESS = STATUS()
   29.         SUCCESS = SUCCESS:" Failed to Open Table TBLCLAIMUSERS"
   31.         RETURN
   32.    END


   31.      GOSUB CREATE.PROVIDER.TABLES

  1.       RETURN

 

 

Back Lesson 1

Newest Jobs

Universe DBA
Company: Eltas Enterprises, INC
Category: Computer/IT
Type: Internship
Posted: July 14, 2010


Our Sponsors

68°
20°
°F | °C
Clear
Humidity: 78%
Wind: N at 0 mph
Sun

61 | 85
16 | 29
Mon

63 | 84
17 | 28
Tue

61 | 84
16 | 28
Wed

59 | 82
15 | 27