FLAT & VSAM files

Top  Previous  Next

A flat file is a file containing records that have no physical record organization: on Unix/Linux and Windows records are only a logical entity. XVSAM bypasses this limit and allows to have files with a record-based organization, which may be accessed either in sequential or keyed mode.

During the conversion process it is important to define if a file will be handled as flat or XVSAM, and, due to the different kind of organization, direct operations on file (i.e creation, deleting, copy, etc) must be converted differently.

In the following paragraphs, some example of conversion will be shown.

Define

vsam

Mainframe:

// EXEC IDCAMS,SIZE=AUTO                                               
  DEFINE CL(NAME(VA.PMEDIO.COS)                     -
         SPEED SHR(4) RECSZ(039 039) REC(0100 0100) -
         KEYS(19 00) VOL(VAVOL5) INDEXED)           -
         CATALOG (VACAT5)                           -
      DATA(NAME(VA.PMEDIO.COS.DATA) CISZ(2048))     -
      INDEX(NAME(VA.PMEDIO.COS.INDX) CISZ(512))            
/*

Unix, Linux & Windows:

xvsam --create --catalog VACAT5 --record-length 39 --key 0,19 --type ksds VA.PMEDIO.COS

flat

Mainframe:

// EXEC IDCAMS,SIZE=AUTO                                               
  DEFINE  CLUSTER(             -
          NAME(VA.GDBT10   )   -
          SPEED                -
          RECORDS (50 50)      -
          NONINDEXED           -
          RECORDSIZE (200 200) -
          CISZ (4096)          -
          REUSE                -
          VOLUMES (WKVOL1)     -
          )                    -
          DATA (               -
          NAME (VA.GDBT10.DATA)-
          )
/*

Unix, Linux & Windows:

touch $XVSAM/WKCAT1/VA.GDBT10

Delete

vsam

Mainframe:

// EXEC IDCAMS,SIZE=AUTO
  DELETE (VA.PMEDIO.COS) PURGE CAT(VACAT5)
/*

Unix, Linux & Windows:

xvsam --delete --catalog VACAT5 VA.PMEDIO.COS

flat

Mainframe:

// EXEC IDCAMS,SIZE=AUTO
  DELETE (VA.GDBT10   ) PURGE NOERASE CLUSTER CAT(WKCAT1)
/*

Unix, Linux:

rm -f $XVSAM/$IJSYSUC/VA.GDBT10

Windows:

del %XVSAM%\%IJSYSUC%\VA.GDBT10

Alter

vsam

Mainframe:

* JOB ALTER
// EXEC IDCAMS,SIZE=AUTO
  ALTER VA.ORD.S NEWNAME(VA.ORD.IM.S) CAT(VACAT5)
  END
/*

Unix, Linux & Windows:

xvsamRename VACAT5 VA.ORD.S VACAT5 VA.ORD.IM.S

flat

Mainframe:

* JOB ALTER
// EXEC IDCAMS,SIZE=AUTO
  ALTER VA.GDBT10 NEWNAME(VA.GDBT10.OLD) CAT(WKCAT1)
  END
/*

Unix, Linux:

mv $XVSAM/WKCAT1/VA.GDBT10 $XVSAM/WKCAT1/VA.GDBT10.OLD

Windows:

move %XVSAM%\WKCAT1\VA.GDBT10 %XVSAM%\WKCAT1\VA.GDBT10.OLD

Repro

vsam

Mainframe:

// DLBL INPU,'IPOST.ASSFAM.ANAG',,VSAM,CAT=IPUCT06
// DLBL OUTP,'IPOST.ASSFAM.ANAG.CALC',,VSAM,CAT=IPUCT02
// EXEC IDCAMS
  REPRO INFILE (INPU) OUTFILE(OUTP)
/*

Unix, Linux & Windows:

xvsam --repro        --input-catalog IPUCT06 --input-cluster IPOST.ASSFAM.ANAG \
                       --output-catalog IPUCT02 --output-cluster IPOST.ASSFAM.ANAG.CALC

flat

Mainframe:

// DLBL IJSYSUC,'WKCAT1',,VSAM
// DLBL IN,'PPROD8J.TXT',,VSAM,CAT=WKCAT1
// DLBL OUT,'PPROD8J.TXT',,VSAM,CAT=VACAT5
// EXEC IDCAMS,SIZE=AUTO
REPRO INFILE(IN) OUTFILE(OUT)
/*

Unix, Linux & Windows:

cp $XVSAM/WKCAT1/PPROD8J.TXT $XVSAM/VACAT5/PPROD8J.TXT