Migrating Business BASIC/V Files [ HP Business BASIC/XL Migration Guide ] MPE/iX 5.0 Documentation
HP Business BASIC/XL Migration Guide
Chapter 4 Migrating Business BASIC/V Files
Introduction
The following kinds of files require migration:
* BASIC SAVE files
* BASIC DATA and binary files
Information about migrating both these kinds of files is presented in
this chapter.
The following kinds of files can be shared between compatibility mode
Business BASIC/V programs and native mode HP Business BASIC/XL programs:
* Form files
* Database files
* Database schema files
* Configuration files
Migrating BASIC SAVE Files
The BASIC SAVE program file format is different on MPE XL because of
differences in the interpreter's internal tables. You cannot use BASIC
SAVE files that were created on MPE V (or in compatibility mode) in the
native mode interpreter and compiler. Therefore, you must change
compatibility mode BASIC SAVE (BSAVE) files to native mode BASIC SAVE
(BSVXL) files (by using ASCII intermediate files). A new set of BASIC
SAVE, BSVXL, files can be created by using GETs and SAVEs in the HP
Business BASIC/XL interpreter. The HP Business BASIC/XL compiler
compiles BSVXL files into native mode object files that are usable on MPE
XL.
You can write an HP Business BASIC/XL program that changes compatibility
mode BASIC SAVE files in one group to native mode BASIC SAVE files in
another group by using the CATALOG statement. The following program
demonstrates this process:
NOTE Change the following to make the program below work for you:
* "From_group$" in line 130 to your own source group name
* "To_group$" in line 150 to the target group name
* "password" in line 240 to your password
* "user.group" in lines 240, 250, and 500 to your user and group
name
___________________________________________________________________________________
| |
| |
| 10 ! |
| 20 ! Set up files: JCOPYBSV - the job stream file |
| 30 ! CATGROUP - to hold all BASIC SAVE filenames |
| 40 ! in source group |
| 50 ! |
| 80 CREATE ASCII "JCOPYBSV" |
| 90 ASSIGN #1 TO "JCOPYBSV" |
| 100 CREATE ASCII "catgroup" |
| 110 DIM From_group$[8],To_group$[8],Temp_string$[80] |
| 120 DIM Header_str$[50] |
| 130 From_group$="SAVEV" !The source program name |
| 150 To_group$="SAVEXL" !The target group name |
| 160 SEND SYSTEM OUTPUT TO "catgroup" |
| 170 CAT FILE="@."+From_group$,TYPE="BSAVE" !Get the filename of all BASIC |
| 180 SEND SYSTEM OUTPUT TO DISPLAY !SAVE files in source group |
| 190 ! |
| 200 ASSIGN #2 TO "catgroup" |
| 210 ! |
| 220 ! Write job stream header |
| 230 ! |
| 240 PRINT #1;"!JOB JCOPYBSV,user.group/password; outclass = pp,2" |
| 250 PRINT #1;"!Tell user.group; JCOPYBSV start" |
| 260 PRINT #1;"!CONTINUE" |
| 270 ON END #2 GOTO Job_done |
| 280 ! |
| 290 ! Start to read each file name in the source group |
| 300 ! |
| 310 Read_next_filename: ! |
| 320 LINPUT #2;Temp_string$ |
| 330 IF Temp_string$[11;5]="BSAVE" THEN |
| 340 File_name$=RTRIM$(Temp_string$[1,8]) |
| 350 PRINT #1;"!RUN HPBB.PUB.SYS" !Run CM BBASIC |
| 360 PRINT #1;"GET "+File_name$+"."+From_group$ !Get the CM BBSAVE |
| 370 PRINT #1;"PURGE TEMP" |
| 380 PRINT #1;"LIST TO TEMP" !List to an ASCII file |
| 390 PRINT #1;"EXIT" |
| 400 PRINT #1;"!RUN HPBBXLI.PUB.SYS" |
| 410 PRINT #1;"GET TEMP" !Get the ASCII file |
| 420 PRINT #1;"RESAVE "+File_name$+"."+To_group$ !Save in NM BASIC SAVE |
| 430 PRINT #1;"EXIT" !format |
| 440 ENDIF |
| |
___________________________________________________________________________________
Figure 4-1. Migrating BASIC SAVE Files
______________________________________________________________________
| |
| |
| 450 GOTO Read_next_filename |
| 460 Job_done: ! |
| 470 ! |
| 480 ! |
| 490 ! |
| 500 PRINT #1;"!Tell user.group; JCOPYBSV done" |
| 510 PRINT #1;"!EOJ" |
| 520 PRINT "Done creating job stream. Stream JCOPYBSV." |
| 530 END |
| |
______________________________________________________________________
Figure 4-1. Migrating BASIC SAVE Files (Continued)
The previous sample program creates and executes the following job stream
file, JCOPYBSV. JCOPYBSV changes compatibility mode BASIC SAVE files in
one group to native mode BASIC SAVE files in another group.
_______________________________________________________________
| |
| |
| !JOB JCOPYBSV,user.group/pass; outclass = pp,2 |
| !Tell user.group; JCOPYBSV start |
| !CONTINUE |
| !RUN HPBB.PUB.SYS |
| GET ANYPBENC.SAVEV |
| PURGE TEMP |
| LIST TO TEMP |
| EXIT |
| !RUN HPBBXLI.PUB.SYS |
| GET TEMP |
| RESAVE ANYPBENC.SAVEXL |
| EXIT |
| !RUN HPBB.PUB.SYS |
| GET DOPURGE.SAVEV |
| PURGE TEMP |
| LIST TO TEMP |
| EXIT |
| !RUN HPBBXLI.PUB.SYS |
| GET TEMP |
| RESAVE DOPURGE.SAVEXL |
| EXIT |
| !Tell user.group; JCOPYBSV done |
| !EOJ |
| |
_______________________________________________________________
Figure 4-2. Example Job Stream File for Migrating BASIC SAVE Files
JCOPYBSV (above) changes compatibility mode BASIC SAVE files in one group
to native mode BASIC SAVE files in another group. You can modify this
sample program by creating a set of temporary ASCII files, then creating
a set of native mode SAVE files. To create a set of temporary ASCII
files, use the compatibility mode interpreter. To create a set of native
mode SAVE files, use the native mode interpreter. This process speeds
migrations because it prevents you from having to enter and exit the
native mode and compatibility mode interpreters.
MPE/iX 5.0 Documentation