Copy one PS file into another PS file by Multiple times

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
venky
Active Member
Posts: 50
Joined: Sat May 12, 2012 10:13 pm

Copy one PS file into another PS file by Multiple times

Post by venky » Wed Jul 01, 2015 6:11 pm

Hi,

I want to copy a PS File which is having 100 records and this PS file should copy multiple times into another PS File say like 10 times.

So the output will be having 1000 records. Please anybody look into this. Thanks.

Regards,
Venky.

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Wed Jul 01, 2015 7:59 pm

Use OUTFIL with REPEAT=10, which will put 10 copies of each record on your output dataset.

venky
Active Member
Posts: 50
Joined: Sat May 12, 2012 10:13 pm

Post by venky » Wed Jul 01, 2015 11:57 pm

Thanks William,

OUTFIL with REPEAT is working, but i have one more question. Please see below.

Input file:

01
02
03

Now for the above input I am using OUTFIL REPEAT = 3, I am getting the ouput as below.

Output:

01
01
01
02
02
02
03
03
03

but I want the output as below.
Output:

01
02
03
01
02
03
01
02
03

Can you please once again look into this. Thank you.

Regards,
Venky.

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Thu Jul 02, 2015 12:07 am

Well, what I'd do is, where you want to process your 10x file, concatenate the same DSN 10 times.

That will give you 10 copies of the data for whatever is processing it.

If you are desperate to have one DSN, you can do this by concatenating it 10 times (strictly nine concatenations to itself) on //SORTIN DD and use a simple OPTION copy to create your output DSN.

venky
Active Member
Posts: 50
Joined: Sat May 12, 2012 10:13 pm

Post by venky » Thu Jul 02, 2015 12:22 am

Thank you William, yes as you said we can give 10 times the same file for getting my output, instead of giving 10 times the same file is there any chance to rectify by using REPEAT Option only for getting my ouput.

REgards,
Venky.

juliaroberts
Member
Posts: 1
Joined: Tue Jul 07, 2015 2:44 pm
Contact:

Post by juliaroberts » Tue Jul 07, 2015 2:50 pm

Thank you william, REPEAT is working with OUTFIL. :lol:

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