Copying Unix files to MVS Datasets

  • Post category:JCLUtilities
  • Reading time:1 mins read

As mentioned in the previous post, another sample. This one copies a z/OS unix file to an MVS dataset. Also using OCOPY.

//STEP5 EXEC PGM=IKJEFT01 
//INUNIX DD PATH='/mydir/infile.txt',PATHOPTS=(ORDONLY) 
//OUTMVS DD DSN='TEST.MVS.OUTDS',DISP=SHR 
//* 
//SYSTSPRT DD SYSOUT=* 
//SYSTSIN DD * 
//SYSTSIN DD * 
 OCOPY IND(INUNIX) OUTDD(OUTMVS) TEXT CONVERT(YES) PATHOPTS(USE) 
/* 
 

Copying MVS Datasets to Unix files

  • Post category:JCLUtilities
  • Reading time:1 mins read

Recently I had to get some people started with a few utilities. I thought to share this here. They will be in the next few posts for searchability reasons.

There are more ways to Rome, as we say here, so please feel free share you variants in a comment. (I unfortunately need manually curate comments to filter out the spam which is even with this small site overwhelming.)

//STEP1 EXEC PGM=IKJEFT01
//INMVS DD DSN=TEST.TRADMVS.DATA,
// DISP=SHR
//OUTFILE DD FILEDATA=TEXT,
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
// PATHMODE=SIRWXU,
// PATH='/mydir/myunixfile.txt’
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*//SYSTSIN DD *
 OCOPY IND(INMVS) OUTDD(OUTFILE)
//*

Here’s a link to the IBM documentation on OCOPY.