concatenate datasets using multiple sortin

jcl interview questions

Moderator: Moderator Group

Post Reply
sumit_mainframe
Member
Posts: 4
Joined: Thu Jan 21, 2010 11:45 am

concatenate datasets using multiple sortin

Post by sumit_mainframe » Fri Apr 16, 2010 11:47 am

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

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

Post by Natarajan » Fri Apr 16, 2010 11:05 pm

Post this on "DFSORT , ICETOOL & Utilities" forum.
You may need to use ICETOOL for this.
Natarajan
Chennai

rahul_swarnkar
Member
Posts: 3
Joined: Wed Sep 22, 2010 7:35 pm
Location: India

Post by rahul_swarnkar » Wed Sep 22, 2010 8:27 pm

hi sumit,
you can use pgm=iebgener.and using this u can concatenate those file in one single file.i have done it.
my name is rahul swarnkar.

Sandeep Kumar Bits
Member
Posts: 1
Joined: Sun May 22, 2011 6:26 pm
Location: New York
Contact:

Post by Sandeep Kumar Bits » Sun May 22, 2011 6:39 pm

yes,

we can solve this using JCL IEBGENER Utility

IN SYSUT1 concat input file and use generate field with record field,and give record length and starting position.

best wishes
Sandeep Kumar :D

fredrick andrews
Member
Posts: 15
Joined: Thu Feb 23, 2012 6:55 am

Post by fredrick andrews » Thu Feb 23, 2012 8:42 am

Can someone please post the JCL for this...

Sort has made IEBGENER shy away at least from me..

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Thu Feb 23, 2012 9:53 am

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.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

vids
Member
Posts: 1
Joined: Fri Mar 01, 2013 3:39 pm

Post by vids » Fri Mar 01, 2013 3:55 pm

//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

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Sun Mar 03, 2013 6:45 am

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

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue Mar 05, 2013 5:25 pm

The original post in this thread is around 3 years old - are we still replying? :)
Regards,
Anuj

academyindia4

Topic deleted by Admin

Post by academyindia4 » Sat Jan 30, 2016 11:19 pm

<< Content deleted By Admin >>

MainFrameNovice2017
Member
Posts: 1
Joined: Tue Mar 07, 2017 3:46 am

Knock!Knock!

Post by MainFrameNovice2017 » Tue Mar 07, 2017 3:50 am

Anyone has a solution for this question? am I the only one who is still looking for this solution in 2017?

Post Reply

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



Other References
Mainframe Tools and others