Are you an Easytrieve customer looking for a way to convert UNIX files from EBCDIC to ASCII (and vice versa) at a field level? The files being transferred to UNIX will have to undergo field level conversion of the alpha fields ONLY from EBCDIC to ASCII. Easytrieve UNIX ships a UNIX-specific version of Easytrieve Toolkit with the macros to accomplish the task.
MIGRATION CONSIDERATIONS
MIGRATE A PROGRAM
The basic procedure to migrate an Easytrieve Plus program from the mainframe to any UNIX\LINUX box is to ftp the program(s) from the mainframe PDS to a UNIX\LINUX directory in ASCII format (not BIN). Remove the leading and trailing JCL. Revise the PARM and any hard coded hexadecimal EBCDIC statements. Compile and edit until all compile errors have been resolved. You can practice by following these exact steps.
MIGRATE A FILE
The basic procedure to migrate a flat EBCDIC file from the mainframe to any UNIX\LINUX box is to ftp the file(s) from the mainframe to a UNIX\LINUX directory in binary format (bin). You can practice by following these exact steps.
CONVERT EBCDIC TO ASCII
The EBCDIC file(s) transferred to the UNIX\LINUX box in binary format to maintain the integrity of the numeric and packed field values. The problem is that the alphabetic data is in EBCDIC format and when printed it prints unexpected characters and symbols. The solution is to write an Easytrieve Plus program on the UNIX\LINUX box that uses the /toolkit macro %CONVEA. The purpose of the %CONVEA macro is to convert EBCDIC data to ASCII. Additionally write a shell script to automate the compile and execute procedure.
PROGRAM to convert EBCDIC to ASCII
/home/CAI/userid/migrate :$ cat convert1.ezt FILE PERSNL1 F (150) REGION 1 1 N BRANCH 2 2 N NAME-LAST 17 8 A HEADING('LAST' 'NAME') NAME-FIRST 25 8 A HEADING('FIRST' 'NAME') PAY-GROSS 94 4 P 2 HEADING('GROSS' 'PAY') FILE CONVERT F (150) CREGION 1 1 N CBRANCH 2 2 N CNAME-LAST 17 8 A CNAME-FIRST 25 8 A CPAY-GROSS 94 4 P 2 JOB INPUT PERSNL1 PRINT RPT1 %CONVEA DBFILE STARTPOS NAME-LAST LENGTH 77 PUT CONVERT FROM PERSNL1 REPORT RPT1 LINESIZE 80 SEQUENCE REGION BRANCH NAME-LAST TITLE 'READING THE UN-CONVERTED FILE' LINE 1 REGION BRANCH NAME-FIRST NAME-LAST PAY-GROSS JOB INPUT CONVERT PRINT RPT2 REPORT RPT2 LINESIZE 80 SEQUENCE CREGION CBRANCH CNAME-LAST TITLE 'READING THE CONVERT FILE' LINE CREGION CBRANCH CNAME-FIRST CNAME-LAST CPAY-GROSS
SCRIPT to compile and include a /toolkit macro
ezt +L -I/home/CAI/abcdefg/ez014b/toolkit -o $1 $1.ezt /home/CAI/abcdefg/ez014b
/toolkit/libezttool.a
$1
FTP NOTE:
If you want to FTP multiple files at once: