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

JCL for FTP and Database Load


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sripriya

New User


Joined: 19 Apr 2005
Posts: 26

PostPosted: Tue Mar 07, 2006 3:15 pm
Reply with quote

Hi all,

I need a JCL which FTPs the files from the server and loads it into the database.

Sripriya.
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Tue Mar 07, 2006 6:07 pm
Reply with quote

Hi,

Quote:
I need a JCL which FTPs the files from the server and loads it into the database.


could you please elaborate menaing of " loads into database"


If u want to download file from server to flat file please find the JCL

Code:
//FTP10  EXEC  PGM=FTP,PARM='(TIMEOUT 720'                     
//OUTPUT   DD SYSOUT=*                                         
//SYSPRINT DD SYSOUT=*                                         
//INPUT    DD *                                                 
Ip address                                                     
userid                                                         
password                                                         
CD path                                                       
get server file name 'mainframe file naem' (REPLACE
QUIT


I hope it helps

Regards
Rupesh
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Tue Mar 07, 2006 6:46 pm
Reply with quote

Code:

//STEP0001 EXEC PGM=FTP,PARM='server.name (Exit=8'               
//NETRC    DD   DISP=SHR,DSN=&SYSUID..NETRC                       
//OUTPUT   DD   SYSOUT=*                                           
//T1       DD   DSN=&&T1,DISP=(,PASS),             
//         UNIT=(SYSDA),SPACE=(CYL,(100,100),RLSE),
//         RECFM=FB,LRECL=80                   
//Tn       DD   DSN=&&Tn,DISP=(,PASS),             
//         UNIT=(SYSDA),SPACE=(CYL,(100,100),RLSE),
//         RECFM=FB,LRECL=80
//INPUT    DD   *
sendsite                                                           
ascii                                                             
cd directory
get filename1.ext //dd:T1
get filenamen.ext //dd:Tn
qui                                                               
/*     
//*               
//STEP0002 EXEC ORALDR,SSN=PGEN,PARM='PARFILE=/DD/PARMS'       
//TNSNAMES DD   *                                             
XXXNN =                                                       
(DESCRIPTION =                                                 
    (ADDRESS = (PROTOCOL = TCP)(HOST=hostname)(PORT = 1521))   
     (CONNECT_DATA =                                           
       (SERVICE_NAME = XXXXXXXX))                             
 )                                                             
/*                                                             
//BADDD    DD   SYSOUT=*                                       
//DSCDD    DD   SYSOUT=*                                       
//LOGDD    DD   SYSOUT=*                                       
//PARMS    DD   *                                             
USERID=                                                       
USER/PASSWORD                                                 
CONTROL=/DD/LDRCTL LOG=/DD/LOGDD DIRECT=FALSE                 
/*                                                             
//LDRCTL   DD   *                                   
LOAD DATA                                           
INFILE /DD/LDRDATA                                 
BADFILE /DD/BADDD                                   
REPLACE                                             
INTO TABLE table                                   
(fld     Position(01:80) Char)                     
/*                                                 
//LDRDATA  DD   DSN=&&T1,DISP=(OLD,DELETE)         
//         DD   DSN=&&Tn,DISP=(OLD,DELETE)         
//*                                                 
Back to top
View user's profile Send private message
sripriya

New User


Joined: 19 Apr 2005
Posts: 26

PostPosted: Wed Mar 08, 2006 11:26 am
Reply with quote

Hi,

Thank u very much for the sufficient information.

Sripriya.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts How to load to DB2 with column level ... DB2 6
No new posts REASON 00D70014 in load utility DB2 6
No new posts What database does Jobtrac use CA Products 4
No new posts Capturing COBOL job and program names... All Other Mainframe Topics 2
Search our Forums:

Back to Top