View previous topic :: View next topic
|
Author |
Message |
farnear Currently Banned New User
Joined: 27 Nov 2008 Posts: 20 Location: India
|
|
|
|
friends,
I want to override the file name &USERID.FTP.LSOUTPUT while doing "ls" command.
Can any one tell is it possible to execute PGM=FTP command using REXX commands , and then outtrap the results of "ls -l" and then move the results of this outtrap into user defined file.
We are facing problem with &USERID.FTP.LSOUTPUT in case of duplicates. we dont this system generated file.
can any one help pls
BAN: Moved to Student forum as requested by the user. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
And I have deleted your duplicate post !!!
DO NOT POST THE SAME TOPIC MORE THAN ONCE |
|
Back to top |
|
|
farnear Currently Banned New User
Joined: 27 Nov 2008 Posts: 20 Location: India
|
|
|
|
hi
this is the JCL I executed.
//H199041$ JOB (ACCT#),MSGCLASS=X,MSGLEVEL=(1,1),CLASS=A,
// REGION=0M,NOTIFY=&SYSUID
//FTP01 EXEC PGM=FTP,DYNAMNBR=50
//SYSPRINT DD SYSOUT=*
//AMSDUMP DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSIN DD DUMMY
//INPUT DD *
server name
userid
password
cd '/user/h199041/test'
PWD
ascii
ls -l (disk
QUIT
I want to store the output of "ls -l " in an output file. We are facing problem with &userid.ftp.lsoutput as in production if two jobs are running at the same time there is a chance of duplication while creating this file.
is there any solution to store the output of "ls -l" in the user defined file instead of &userid.ftp.lsoutput
Let me know if we can run FTP commands using REXX so that I can use outtrap to capture the o/p of Ls command.
pls help.
--farnear |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
The Communications Server User's Guide says there's not a lot of choice on where the output goes:
Quote: |
Disk
Stores the results of the LS subcommand in the user_id.FTP.LSOUTPUT data set. The results are not displayed on the screen.
| Note: If the local current working directory is a z/OS UNIX file
| system directory, the results are stored in a file named LSOUTPUT. |
You may want to set up a lock file and have it in your JCL with DISP=OLD to prevent two jobs from running simultaneously. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Here's my thought:
Yes, use REXX to perform the FTP and allow a unique dataset name for the "ls -l (Disk" output:
Code: |
//*
//STEP0001 EXEC PGM=ICEGENER
//SYSUT1 DD *,DLM=@@
/* REXX */
jobname = MVSVAR('SYMDEF','JOBNAME')
newpds = Arg(1)||".PDS."||jobname
"ALLOC F(x) DA('"newpds"') MOD REUSE DELETE"
"FREE F(x)"
"ALLOC F(x) DA('"newpds"') NEW REUSE CATALOG RECFM(F B) LRECL(80)",
"SPACE(1,1) CYLINDERS DIR(1)"
Queue userid
Queue password
Queue "sendsite"
Queue "ascii"
Queue "lcd '"newpds"'"
Queue "ls -l (Disk"
Queue "qui"
"FTP address 21"
"FREE F(x)"
Exit 0
@@
//SYSUT2 DD DSN=&&PDS(X),DISP=(,PASS),UNIT=VIO,
// SPACE=(CYL,(1,1,1),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//*
//STEP0002 EXEC PGM=IKJEFT01,PARM='%X MY.HLQ'
//SYSPROC DD DSN=&&PDS,DISP=(OLD,DELETE)
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//OUTPUT DD SYSOUT=*
//*
|
The resulting output is stored in 'MY.HLQ.PDS.JOBNAME(LSOUTPUT)'. |
|
Back to top |
|
|
|