IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

output of LS -l disk needs to trapped


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
farnear
Currently Banned

New User


Joined: 27 Nov 2008
Posts: 20
Location: India

PostPosted: Wed Apr 01, 2009 10:52 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Wed Apr 01, 2009 1:42 pm
Reply with quote

google for "z/os rexx ftp client api"

here is one hit
publib.boulder.ibm.com/infocenter/ieduasst/stgv1r0/index.jsp?topic=/com.ibm.iea.commserv_v1/commserv/1.8z/appl/FTPrexxAPI/player.html

looks very promising
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Wed Apr 01, 2009 2:12 pm
Reply with quote

And I have deleted your duplicate post !!!

DO NOT POST THE SAME TOPIC MORE THAN ONCE
Back to top
View user's profile Send private message
farnear
Currently Banned

New User


Joined: 27 Nov 2008
Posts: 20
Location: India

PostPosted: Wed Apr 01, 2009 2:37 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Wed Apr 01, 2009 5:01 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Apr 02, 2009 1:46 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts Reroute print output via REXX/SDSF TSO/ISPF 6
No new posts Concatenate 2 input datasets and give... JCL & VSAM 2
No new posts How to turn off 'ACTION' SDSF output ... TSO/ISPF 2
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
Search our Forums:

Back to Top