Friday, 6 July 2012

Repro


Now I have to copy my PS file data into my VSAM file.

So REPRO command is used to copy a PS or GDG dataset data to VSAM file.
Repro command uses IDCAMS utility for it's operation.


Loading data from PS or GDG file to KSDS file.
*Sample program
//REPRO123   JOB 'CRIS','AVINASH',NOTIFY=&SYSUID          
//STEP1 EXEC PGM=IDCAMS                                   
//SYSPRINT DD SYSOUT=*                                    
//SYSOUT DD SYSOUT=*                                      
//DD1 DD DSN=ak999.AVINASH.PS1,                          
//     DISP=OLD                                          
//DD2 DD DSN=ak999.AVINASH.KSDS1,                         
//     DISP=OLD                                           
//SYSIN DD *                                              
   REPRO INFILE(DD1) OUTFILE(DD2)                         
/*                                                        
//  





Intially my PS file data is



  

KSDS file data is



                                             
Now I will show you the output of a program.

This will gives me a maxcc of 12.



As the records are not ascending order so it will not insert the record in between two data names.

Now I will delete all the records of KSDS file so it will be empty.



Now I will submit same job will gives me maxcc=0.





Repro for ESDS file

Here i am using same PS file.






ESDS file content before submitting a job.




Content after executing a job.




Here records are added at last.

Repro command for RRDS dataset.

see below JCL program.






Here Record length of PS file and RRDS file must be same then only content will copy from PS file to RRDS dataset.

so first you can check the PS dataset record length by typing 'I' against dataset.

will gives you below information.

so when you define your RRDS file use same record length.





If record length is not matching then will gives you maxcc=12. see below error.









No comments:

Post a Comment