Hi,
I am having a problem in copying some selected records from 10 different files into a single file.
Below is the discription--
I want to copy records from 10 file ,but each file has different no of records. I want to copy data from only the first line and from
position 27 to 35. The output file should contain records appended from all the files.
The JCL which i have written is working fine for single file, but not for multiple files.
Please help me ASAP.
Thanks,
Sumit
I want a JCL to copy specified number of records
Moderators: Frank Yaeger, DikDude, Moderator Group
-
- Member
- Posts: 4
- Joined: Thu Jan 21, 2010 11:45 am
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
ASAP is not a nice word, usually given as a command.
if you wanted to be nice, you should have said something like,
this is urgent to me.
would have been helpful to see the job that you have.
depending on what utility you used in the job step,
we could have easily provided you help.
especially, since this is an ASAP kind of thing, you don't want to have us waste your time providing potentially useless suggestions (utilities that you do not have).
if you can do it with one file, suggest that you add 9 additional steps with the disposition of the output file being mod.
if you wanted to be nice, you should have said something like,
this is urgent to me.
would have been helpful to see the job that you have.
depending on what utility you used in the job step,
we could have easily provided you help.
especially, since this is an ASAP kind of thing, you don't want to have us waste your time providing potentially useless suggestions (utilities that you do not have).
if you can do it with one file, suggest that you add 9 additional steps with the disposition of the output file being mod.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
-
- Member
- Posts: 4
- Joined: Thu Jan 21, 2010 11:45 am
-
- Member
- Posts: 4
- Joined: Thu Jan 21, 2010 11:45 am
Hi all,
Below is the job, which i am trying.
//BKPJCL01 JOB 00000000, 'BKP JCL',MSGCLASS=A,CLASS=A,NOTIFY=&SYSUID
//STEP00 EXEC PGM=SORT,REGION=4096K
//SORTIN DD DISP=SHR,DSN=PWSX.SUMIT.TEST01.ABC.TC1
//* DD DISP=SHR,DSN=PWSX.SUMIT.TEST01.ABC.TC2
//* DD DISP=SHR,DSN=PWSX.SUMIT.TEST01.ABC.TC3
//* DD DISP=SHR,DSN=PWSX.SUMIT.TEST01.ABC.TC4
//* DD DISP=SHR,DSN=PWSX.SUMIT.TEST01.ABC.TC5
//* DD DISP=SHR,DSN=PWSX.SUMIT.TEST01.ABC.TC6
//* DD DISP=SHR,DSN=PWSX.SUMIT.TEST01.ABC.TC7
//* DD DISP=SHR,DSN=PWSX.SUMIT.TEST01.ABC.TC8
//* DD DISP=SHR,DSN=PWSX.SUMIT.TEST01.ABC.TC9
//SORTOUT DD DSN=PWSX.KASPAG5.TEST.BKP2,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY,
STOPAFT=1
OUTREC FIELDS=(1,4,27,3)
//SYSOUT DD SYSOUT=X
//SYSUDUMP DD SYSOUT=X
//SORTLIB DD DSN=SYS1.SORTLIB,DISP=(SHR,KEEP,KEEP)
//SORTWK01 DD UNIT=DISK,SPACE=(6233,(5000,3000),RLSE,,ROUND)
//SORTWK02 DD UNIT=DISK,SPACE=(6233,(5000,3000),RLSE,,ROUND)
//SORTWK03 DD UNIT=DISK,SPACE=(6233,(5000,3000),RLSE,,ROUND)
//SORTWK04 DD UNIT=DISK,SPACE=(6233,(5000,3000),RLSE,,ROUND)
Please provide me the solution.
Thanks,
Sumit
Below is the job, which i am trying.
//BKPJCL01 JOB 00000000, 'BKP JCL',MSGCLASS=A,CLASS=A,NOTIFY=&SYSUID
//STEP00 EXEC PGM=SORT,REGION=4096K
//SORTIN DD DISP=SHR,DSN=PWSX.SUMIT.TEST01.ABC.TC1
//* DD DISP=SHR,DSN=PWSX.SUMIT.TEST01.ABC.TC2
//* DD DISP=SHR,DSN=PWSX.SUMIT.TEST01.ABC.TC3
//* DD DISP=SHR,DSN=PWSX.SUMIT.TEST01.ABC.TC4
//* DD DISP=SHR,DSN=PWSX.SUMIT.TEST01.ABC.TC5
//* DD DISP=SHR,DSN=PWSX.SUMIT.TEST01.ABC.TC6
//* DD DISP=SHR,DSN=PWSX.SUMIT.TEST01.ABC.TC7
//* DD DISP=SHR,DSN=PWSX.SUMIT.TEST01.ABC.TC8
//* DD DISP=SHR,DSN=PWSX.SUMIT.TEST01.ABC.TC9
//SORTOUT DD DSN=PWSX.KASPAG5.TEST.BKP2,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY,
STOPAFT=1
OUTREC FIELDS=(1,4,27,3)
//SYSOUT DD SYSOUT=X
//SYSUDUMP DD SYSOUT=X
//SORTLIB DD DSN=SYS1.SORTLIB,DISP=(SHR,KEEP,KEEP)
//SORTWK01 DD UNIT=DISK,SPACE=(6233,(5000,3000),RLSE,,ROUND)
//SORTWK02 DD UNIT=DISK,SPACE=(6233,(5000,3000),RLSE,,ROUND)
//SORTWK03 DD UNIT=DISK,SPACE=(6233,(5000,3000),RLSE,,ROUND)
//SORTWK04 DD UNIT=DISK,SPACE=(6233,(5000,3000),RLSE,,ROUND)
Please provide me the solution.
Thanks,
Sumit
There is no way you can do what you want by concatenating the input files together, unless there is something within the files that you can use to determine when you have reached the first record of each file, or unless you insert some sort of control break in between each dataset of the concatenation.
I'd suggest that you use multiple jobs steps with only one file allocated to SORTIN for that step, or assign the files to multiple unique DD names and use ICETOOL or SYNCTOOL (you still haven't suppplied us with the product you use).
I'd suggest that you use multiple jobs steps with only one file allocated to SORTIN for that step, or assign the files to multiple unique DD names and use ICETOOL or SYNCTOOL (you still haven't suppplied us with the product you use).
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
as MrSpock inferred,
I would set-up my sort step as a proc, using symbolics as the SORTIN DSN=...
and use disp=mod for SORTOUT.
and then your JOB would consist of an IEFBR14 to delete the SORTOUT,
and 10 invocations of the proc, using different values for the symbolics each time.
I would also remove the SORTWORK DD statements, as they
are not needed for this JOB
and
as they are resource requirements, may inhibit the JOB from being scheduled to run
until the required resources are available.
I would set-up my sort step as a proc, using symbolics as the SORTIN DSN=...
and use disp=mod for SORTOUT.
and then your JOB would consist of an IEFBR14 to delete the SORTOUT,
and 10 invocations of the proc, using different values for the symbolics each time.
I would also remove the SORTWORK DD statements, as they
are not needed for this JOB
and
as they are resource requirements, may inhibit the JOB from being scheduled to run
until the required resources are available.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
sumit,
Is there anything in the first record of each file that identifies it as such (e.g. HDR in positions 1-3)? What is the RECFM and LRECL of each input file?
Can you use MOD for the SORTOUT data set?
Is there anything in the first record of each file that identifies it as such (e.g. HDR in positions 1-3)? What is the RECFM and LRECL of each input file?
Can you use MOD for the SORTOUT data set?
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
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
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page