Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


I have a file in which I have 20 records. I want my first
record to go into file 1 and second record to go in second
file. I want to copy the alternate records like this in the
two output files. How can I do this using JCL?

Answers were Sorted based on User's Feedback



I have a file in which I have 20 records. I want my first record to go into file 1 and second reco..

Answer / satish

//job statement
//step1 exec pgm=sort
//sortin dd dsn=input file that contain 20 records
//file1 dd dsn=output file
//file2 dd dsn=another output file
//sysout dd sysout=*
//sysin dd *
option copy
outfil fnames=(file1,file2),split
/*

Is This Answer Correct ?    7 Yes 0 No

I have a file in which I have 20 records. I want my first record to go into file 1 and second reco..

Answer / muttaiah

Adding to satish answer.

Option copy is similar to sort fields= copy or merge
fields=copy.
It is used to simply copy the records from input to output
file.

Outfil is used when we want to do process records in the
input file.
Here split option is used in Outfil to seperate the input
file into 2, that means it will write the alternate records
into the files specified in fnames.
Other syntax of Outfill would be

//step1 exec pgm=sort
//sortin dd dsn=Inputfile
//sortof01 dd dsn=file1
//sortof02 dd dsn=file2
//sysin dd *
option copy
outfil files=(01,02),split
/*
Here we are giving 01,02 which indicates the DDnames that
are prefixed with sortof.

Hope this makes sense in understanding satish answer

@All: Do correct me if i'm wrong.

Thank u

Is This Answer Correct ?    6 Yes 0 No

I have a file in which I have 20 records. I want my first record to go into file 1 and second reco..

Answer / bala

we can add seqnum to each record in the file using SORT
command and copy then use INCLUDE & EXCLUDE COND of SORT
for this.

Is This Answer Correct ?    1 Yes 3 No

I have a file in which I have 20 records. I want my first record to go into file 1 and second reco..

Answer / ksingla.vikas

IDCAMS might be helpful for same.

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More JCL Interview Questions

how to solve u4038 abbend?........

3 Answers   Atos Origin, TCS,


What are some jcl statements that are not allowed in procedures?

0 Answers  


In a proc i will concatinate 4 dd statements.i want to overide 3 dd statement through jcl how?

3 Answers  


what is alternate index?

1 Answers  


Explain about LMPUT-

1 Answers  


What is TimeStamp, What is TimeStamp error and What is the Abend Code for TimeStamp Error ?

4 Answers   IBM,


How do you find which GDG is using which dataset?

3 Answers   Patni,


wht happens if cond=true ? pls give me with an example ?

2 Answers   Syntel,


What is dummy parameter in JCL??

3 Answers   TCS,


How to pass values in jcl to cobol?

4 Answers   IBM, Infosys,


can i sort packed decimal if i can tell the syntax

1 Answers   Barclays,


What is model dataset label(Model DSCB)?

1 Answers  


Categories