View previous topic :: View next topic
|
Author |
Message |
tapas.behera Warnings : 1 New User
Joined: 05 Mar 2006 Posts: 1 Location: Bangalore
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
Rupesh.Kothari
Member of the Month
Joined: 27 Apr 2005 Posts: 463
|
|
|
|
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 |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
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 |
|
|
|