Allocate z/os Dataset name using EXPORT

General discussion of the Co:Z Toolkit
Post Reply
tsdjim
Posts: 64
Joined: Fri May 07, 2010 2:21 am

Allocate z/os Dataset name using EXPORT

Post by tsdjim »

I have a program on zLinux that accepts the filename as an environment variable. For example EXPORT INFILE=file.txt under Linux.

Is it possible using COZLauncher to allocate a z/OS dataset to INFILE using EXPORT. For example in STDENV
export INFILE=//zOS.DATA.SET
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

Well, it sounds like your Linux program will want to read file given its name, and it won't be able to open the dataset directly. One way to accomplish this would be to create a named pipe and then fork a Co:Z fromdsn comand to read your dataset.

For example:
// EXEC COZLNCH,ARGS=;myuser@mylinux'
//STDIN DD *
mkfifo mypipe.txt
export INFILE=mypipe.txt
fromdsn //zos.data.set > mypipe.txt &
/path/to/mypgm
rm $INFILE
//
tsdjim
Posts: 64
Joined: Fri May 07, 2010 2:21 am

Thanks thats Resolved

Post by tsdjim »

mkfifo solved it, now I have a timeout problem, but will open another thread for that.

Thanks
Post Reply