concatenate datasets using multiple sortin
Moderator: Moderator Group
-
- Member
- Posts: 4
- Joined: Thu Jan 21, 2010 11:45 am
concatenate datasets using multiple sortin
Hi,
I am trying to concatenate 10 files and put the output in a single file. Below is the discription:
I have 10 files as input and each file has different number of records, now my requirement is that i have to copy data from
the first line only from all the files, also the data which i am copying should be from column 27 to 35.
I want to write a JCL to process all the files in one go.
[my approach]
--------------
I have tried it myself and its working fine for single file, but when i am using multiple files its not working.
I concatenate all the files, but when i submit, it takes data from the first file only.
I am using PGM = sort.
PlZ provide me the solution.
Thanks,
sumit
I am trying to concatenate 10 files and put the output in a single file. Below is the discription:
I have 10 files as input and each file has different number of records, now my requirement is that i have to copy data from
the first line only from all the files, also the data which i am copying should be from column 27 to 35.
I want to write a JCL to process all the files in one go.
[my approach]
--------------
I have tried it myself and its working fine for single file, but when i am using multiple files its not working.
I concatenate all the files, but when i submit, it takes data from the first file only.
I am using PGM = sort.
PlZ provide me the solution.
Thanks,
sumit
-
- Member
- Posts: 3
- Joined: Wed Sep 22, 2010 7:35 pm
- Location: India
-
- Member
- Posts: 1
- Joined: Sun May 22, 2011 6:26 pm
- Location: New York
- Contact:
-
- Member
- Posts: 15
- Joined: Thu Feb 23, 2012 6:55 am
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
as Natarajan indicated, 2 years ago,
you need a sort solution,
it would require 9 iebgener steps.
using DFSORT (probably syncsort also)
you would have 10 DD statements for input.
remember when you use JCL file concatenation
(multiple DSN's under 1 DD)
all 10 files are treated a 1 file. (that is what concatenation does)
Fredrick Andrews,
if you wish a solution for this
create a topic in the appropriate forum
DFSORT for ibm's DFSORT
JCL for all other sort products.
this publication for DFSORT SORT TRICKS
provides some examples.
you need a sort solution,
it would require 9 iebgener steps.
using DFSORT (probably syncsort also)
you would have 10 DD statements for input.
remember when you use JCL file concatenation
(multiple DSN's under 1 DD)
all 10 files are treated a 1 file. (that is what concatenation does)
Fredrick Andrews,
if you wish a solution for this
create a topic in the appropriate forum
DFSORT for ibm's DFSORT
JCL for all other sort products.
this publication for DFSORT SORT TRICKS
provides some examples.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
//Uidxxxxx JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD DSN=Uidxxxxx.$JCL1,DISP=SHR
// DD DSN=Uidxxxxx.$JCL2,DISP=SHR
// DD DSN=Uidxxxxx.$JCL3,DISP=SHR
// DD DSN=Uidxxxxx.$JCL4,DISP=SHR
// DD DSN=Uidxxxxx.$JCL5,DISP=SHR
// DD DSN=Uidxxxxx.$JCL6,DISP=SHR
// DD DSN=Uidxxxxx.$JCL7,DISP=SHR
// DD DSN=Uidxxxxx.$JCL8,DISP=SHR
// DD DSN=Uidxxxxx.$JCL9,DISP=SHR
// DD DSN=Uidxxxxx.$JCL10,DISP=SHR
//SYSUT2 DD DSN=Uidxxxxx.$FINAL,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
GENERATE MAXFLDS=2
RECORD FIELD=(9,27,,1)
bt this one will copy all the lines...from 27th column to 35th column
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD DSN=Uidxxxxx.$JCL1,DISP=SHR
// DD DSN=Uidxxxxx.$JCL2,DISP=SHR
// DD DSN=Uidxxxxx.$JCL3,DISP=SHR
// DD DSN=Uidxxxxx.$JCL4,DISP=SHR
// DD DSN=Uidxxxxx.$JCL5,DISP=SHR
// DD DSN=Uidxxxxx.$JCL6,DISP=SHR
// DD DSN=Uidxxxxx.$JCL7,DISP=SHR
// DD DSN=Uidxxxxx.$JCL8,DISP=SHR
// DD DSN=Uidxxxxx.$JCL9,DISP=SHR
// DD DSN=Uidxxxxx.$JCL10,DISP=SHR
//SYSUT2 DD DSN=Uidxxxxx.$FINAL,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
GENERATE MAXFLDS=2
RECORD FIELD=(9,27,,1)
bt this one will copy all the lines...from 27th column to 35th column
Vids, why have you posted an incorrect solution? It has already been stated that iy cannot be done by concatenating files. The topic starter wants data from the first record of each dataset only. How does your solution a) identify each individual file and b) stop reading each file after one record??
Regards
Nic
Nic
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
-
- Member
- Posts: 1
- Joined: Tue Mar 07, 2017 3:46 am
Knock!Knock!
Anyone has a solution for this question? am I the only one who is still looking for this solution in 2017?
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page