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 do you restart a PROC from a particular step?

5 Answers  


How to see the COMP3 value(packd decimal)

2 Answers   iGate,


How can the disposition of sysout datasets be set for an entire jobstream?

0 Answers  


Can I send output of job to my remote device careerride123?

0 Answers  


Can there be 2 job statements in a JCL? If yes what is the purpose of doing tha?

3 Answers  


What is QSAM error usually when it is occurs?

1 Answers  


Could anyone please suggest me what is the maximum length of data that can be pass as input in //sysin dd * This was asked in interview. TIA

3 Answers   VC, Wipro,


i want apply mainframe devolper with 3+ but i dont have that much of knowledge what isthe solution to get that much of knoweldge?

1 Answers  


How does jcl specify the job to the operating system?

0 Answers  


What is the max blocksize for a Tape file?

2 Answers  


what is the default region size if I dont specify region parametre in my job card ( I know that if I specify region=0k or 0M, then the job will occupy all he available resources at the time of job execution), but I want to know the defult value for "region" paramatre.

5 Answers   BirlaSoft, Infosys,


do we need to mention the location of catalogued procedure for each it's call in a single job?

1 Answers  


Categories