Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

output of LS -l disk needs to trapped

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
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    Post subject: output of LS -l disk needs to trapped
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Wed Apr 01, 2009 1:42 pm    Post subject: Reply to: output of LS -l disk needs to trapped
Reply with quote

google for "z/os rexx ftp client api"

here is one hit
http://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: 8593
Location: Back in jolly old England

PostPosted: Wed Apr 01, 2009 2:12 pm    Post subject:
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    Post subject:
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: 7932
Location: Bellevue, IA

PostPosted: Wed Apr 01, 2009 5:01 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Apr 02, 2009 1:46 am    Post subject: Reply to: output of LS -l disk needs to trapped
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm
This topic is locked: you cannot edit posts or make replies. output data in CSV Format janmejay DFSORT/ICETOOL 3 Sat Oct 15, 2016 2:16 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us