
How to Use SYSTRANS
Load Source from a PC to the Mainframe
By Dieter W. Storr
Last update: 12 May 2006
Problem Description
I received Natural source code, which was recorded on a German PC in lower-case letters and then unloaded by using SYSTRANS.
I ftp'ed it, translated the code from ASCII to EBCDIC, and saved it on a dataset (LRECL=96) on the mainframe.
Then, I used SYSTRANS to load all source code into a new Natural 4.1.3 library. So far so good.
The problem began when I did a CATALL. Some programs failed with error codes that are not understandable. A manual check and catalog received sometimes the same error code and the other time it cataloged OK. But at execution time it failed again. Even the CAT was OK.
For example:
NAT0623 Variable/field/view must be defined in DEFINE DATA.
0100 DEFINE DATA
0110 LOCAL
0120 1 #VAR (I2)
0130 1 #VAR-2 (I2) INIT <0>
0140 END-DEFINE
0150 ON ERROR
0160 ESCAPE ROUTINE
0170 END-ERROR
0180 /* create error */
E 0190 #VAR := #VAR / #VAR-2
0210 END
The source code after translation from ASCII to EBCDIC and before SYSTRANS on the mainframe:
*S**define data
*S** local
*S** 1 #var (i2)
*S** 1 #var-2 (i2) init <0>
*S**end-define
*S**
*S**on error
*S** escape routine
*S**end-error
*S**
*S**
*S**/* create error */
*S**#var := #var / #var-2
*S**
*S**end
And the hex code -- still in SYSTRANS form.
*S**/* create error */
5E556548988A848999945644444
C2CC1C03951350599690C100000
--------------------------
*S**#var := #var / #var-2
5E557A8947747A894647A896F44
C2CCB5190AE0B519010B5190200
--------------------------
Sometimes, when you read this code into the editor, it is in lower case. After you hit the enter-key, it is translated into upper-case letters.
Explanation
SYSTRANS loaded the source into FUSER in lower-case letters because the option "Translate Sources to Upper Case" was set to "N". The source was still in lower case, when loaded into the editor. Also the compilation option "(LOWSRCE) Allow Lower Case Source" was set to "OFF" and the code was translated and displayed in upper-case letters. So CHECK and CAT experienced different results.
Solution
The solution is to use the load option "Translate Sources to Upper Case .. Y" when SYSTRANS it to Natural on the mainframe. See example (3rd parameter).
//NATURAL EXEC NATBATCH,NATPARM=',IM=D,INTENS=1'
//CMSYNIN DD DISP=SHR,BUFNO=30,DSN=&SYSUID..DBA.CNTL(NSC)
// DD *
SYSTRANS
L
N,Y,Y,N,Y,N
*
Y
NEWLIB1
FIN
//CMWKF01 DD DISP=SHR,DSN=NATURAL.NAT413.SRCE
//CMWKF07 DD DUMMY for PC
//
General Load Options
User-Defined Conversion Table .... N (Y/N/F)
Report ........................... Y (Y/N)
Translate Sources to Upper Case .. N (Y/N)
Save Restart Information ......... N (Y/N)
Modify Library Names ............. N (Y/N)
Use Entire Connection work file .. N (Y/N)
Convert Data Area Sources ........ N (Y/N)
Objects to be loaded / CMD
Load All Objects
All objects on work file 1 will be loaded|
Replace ............................ N (Y/N)
Modify Library Names
Old Library Name ................. *
New Library Name ................. *_______
Thanks, Helmut Spichtinger, for the SYSTRANS tip.
Top Page
|