Thanks for your response to me. BTW I will show my source
/* Program 12.1 Writing a file a character at a time */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <tal.h> /* Note 1 */
/*#include <cextdecs.h(FILE_OPEN_,READX)> */
#include <cextdecs (\
READUPDATELOCKX,\
READX,\
FILE_GETINFO_,\
FILE_OPEN_,\
FILENAME_DECOMPOSE_,\
FILENAME_RESOLVE_,\
WRITEUPDATEUNLOCKX\
)>
#include "burn.h"
#define FEOK 0
#define FEEOF 1
_cc_status CC; /* Note 2 */
short retcode;
short gfnum;
char *fname;
char buffer[1024];
burn_def* burn;
/* ================================================== ==== */
int Burn_Open( short* fnumx )
{
printf("Filename = %s\n" , fname );
retcode = FILE_OPEN_(fname, /* name of Guardian file*/
(short)strlen(fname), /* filename length */
fnumx, /* file number returned */
1, /* open for read */
, /* exclusion */
, /* nowait depth */
, /* sync or receive depth */
);
if (retcode != 0) {
fprintf(stderr, "retcode = %d\n", retcode);
fprintf(stderr, "Can’t open %s\n", fname);
exit(1);
}
}
/* ================================================== ==== */
int Burn_read( burn_def* burn , short fnum)
{
short err;
short readcnt;
if (fnum < 0) {
printf("Fnum = %d\n", fnum );
Burn_Open( &fnum );
}
CC = READX( fnum, (char*)burn, sizeof(burn_def), &readcnt );
printf("*********** READX File = ************* \n" );
if(_status_ne(CC))
{
FILE_GETINFO_( fnum, &err );
if (err = FEEOF )
{
printf("Fnum 1 = %d\n", fnum );
printf("NILAI Error = %d\n", err );
printf("Bytes read 1 = %d\n", readcnt);
return err;
}
/* if condition code indicates an error */
fprintf(stderr, "Read error, bytes read = %d\n", readcnt);
exit(-1);
}
printf("Bytes read 2 = %d\n", readcnt);
return FEOK;
}
/* ================================================== ==== */
int main(int argc, char *argv[])
/*int main() */
{
int i;
short err;
/* Get Guardian filename and open the file. */
if (argc > 1)
fname = argv[1];
else
fname = "$DTUS4.TES1DATA.BURN";
printf("MULAI READ FILE ************* \n" );
do
{
err = Burn_read ( burn , gfnum);
printf("LAST err = %d\n", err );
} while (err == FEEOF );
return( FEOK );
}
Maybe I want use my data in base24 like this (not tlf / ptlf ) but I need basic knowledge for access this file (update, delete, read )
FILE DDLBURNS
?dictn
?c burnh!
DEF BURN
02 PRIKEY.
04 BANK-ID PIC X(3).
02 BANK-NAME PIC X(15).
02 MAX-LIMIT PIC 9(8).
end.
file BURNH
#pragma section burn
#pragma fieldalign shared2 __burn
typedef struct __burn
{
struct
{
char bank_id[3];
} prikey;
char bank_name[15] ;
char max_limit[8];
} burn_def;
#define pext_def_Size 0