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

Question relating records and jcl ?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
tapas.behera
Warnings : 1

New User


Joined: 05 Mar 2006
Posts: 1
Location: Bangalore

PostPosted: Sun Mar 05, 2006 12:43 pm
Reply with quote

Hi friends,
Suppose i have 20 records in a file(say file1) and hv another file (say file2).

Now i want to move 10 records (i.e from 1 to 10)from file1 to file2.

So what r things need to be define in the JCL ?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Sun Mar 05, 2006 1:42 pm
Reply with quote

You don't use JCL to copy records; You use JCL to invoke programs or utilities.

In your case, you can use either a utility (SORT, FILEAID), or a program.

Here is a REXX example:
Code:

/* REXX */
 
ADDRESS TSO "EXECIO 10 DISKR INFILE (STEM IN. FINIS"
ADDRESS TSO "EXECIO 10 DISKW OUTFILE (STEM IN. FINIS"
 
EXIT
 


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

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Sun Mar 05, 2006 4:50 pm
Reply with quote

Hi,


Quote:
Hi friends,
Suppose i have 20 records in a file(say file1) and hv another file (say file2).

Now i want to move 10 records (i.e from 1 to 10)from file1 to file2.

So what r things need to be define in the JCL ?


I believe here records means number of lines from Flat file. You can copy no of records using SORT.

Hope this helps

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

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Mon Mar 06, 2006 5:37 pm
Reply with quote

Tapas,


An ?IDCAMS? solution

Code:


//JS00100  EXEC PGM=IDCAMS
//INDD1  DD DSN=your.input.file,
//       DISP=SHR                       
//OUTDD1 DD DSN=your.output.file,           
//       DISP=SHR               
//SYSIN DD *                                     
 REPRO INFILE(INDD1) OUTFILE(OUTDD1) COUNT(10)             
/*                                               



If you wanted to copy records 6-15

Code:


//JS00100  EXEC PGM=IDCAMS
//INDD1  DD DSN=your.input.file,
//       DISP=SHR                       
//OUTDD1 DD DSN=your.output.file,           
//       DISP=SHR               
//SYSIN DD *                                     
 REPRO INFILE(INDD1) OUTFILE(OUTDD1) SKIP(5) COUNT(10)             
/*                                               



Dave
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top