Write to a data set
With ZOAU, you can write multiple lines of text to a PDSE member with any of the following ways:
-
Issuing a shell command:
- Option 1:
decho "This text will be written to the PDSE member MEMBER#1 as 3 records" "${prefix}.SAMPLE.TEXT(MEMBER#1)"
- Option 2:
mvscmd --pgm=IEBGENER --sysprint=* --sysin=dummy --sysut2="${prefix}.sample.text(member#1)" --sysut1=stdin <<zz This text will be written to the PDSE member MEMBER#1 as 3 records zz
-
Calling an API in Python programs:
datasets.write("%s.SAMPLE.TEXT(MEMBER#1)" % HLQ, content=''' This text will be written to the PDSE member MEMBER#1 as 3 records ''')
Without ZOAU, to achieve the same purpose, you need to write the following JCL statements:
//*
//* Write text from SYSUT1 (inline text)
//* to the dataset member **HLQ**.ZOASAMP.SAMPLE.TEXT(MEMBER#1)
//*
//DECHO EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD *
This text will be
written to the PDSE member MEMBER#1
as 3 records
/*
//SYSUT2 DD DSN=@@HLQ@@.ZOASAMP.SAMPLE.TEXT(MEMBER#1),DISP=SHR