Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
zaphany

New User

Joined: 16 May 2006
Posts: 11

 Posted: Fri Jul 28, 2006 6:05 pm    Post subject: question about Sorting multiple files just wondering if DFSORT can do the following scenerio I have 3 VSAM files, all in different length Input : File 1 : length = 10 field 1 9(03) field 2 9(02) field 3 9(05) File 2 : length = 14 field 1 9(03) field 2 9(04) field 3 9(07) File 3 : length = 18 field 1 9(03) field 2 9(04) field 3 9(05) field 4 9(06) Output : File 4 : length =22 field 1 9(03) --> the field 1 in file 1, 2 and 3 field 2 x(01) --> hardcode 'x' for file 1, 'y' for file 2 and 'z' for file 3 field 3 9(18) --> the whole rec of file 1 (with 8 spaces at the end), 2 (with 4 spaces at the end ) and 3 can 1 sort do this scenerio or i have to do the sorting 1 by 1 then merge it? Thanks for your help!

sril.krishy

Active User

Joined: 30 Jul 2005
Posts: 183

 Posted: Sat Jul 29, 2006 12:06 am    Post subject: Hi, Please provide sample data.The problem is little bit confusing. Thank you Krishy
zaphany

New User

Joined: 16 May 2006
Posts: 11

 Posted: Mon Jul 31, 2006 9:42 am    Post subject: Re: question about Sorting multiple files i think i have solved the problem, although i am not sure if the code is the best but it at least the output is what i expected. //SORT3 EXEC PGM=ICETOOL,COND=(5,LE) //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSABOUT DD SYSOUT=* //SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(10,10)) //SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(10,10)) //SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(10,10)) //SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(10,10)) //IN1 DD * 123AAABBBC 345BBBCCCD 456CCCEEEF //IN2 DD * 123FFF111WWWWW 234GGG111RRRRR 456HHH111TTTTT 345JJJEEEZZZZZ //IN3 DD * 123FFF111QQQQQRRRR 111GGG555RRRRRFFFF 333HHH777TTTFFPPPP 345JJJEEEZZZSSSSSS //OUT1 DD DSN=file.name, // DISP=(NEW,CATLG,DELETE), // DCB=(RECFM=FB,LRECL=22,BLKSIZE=0), // SPACE=(TRK,(5,5),RLSE) //T1 DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA //TOOLIN DD * COPY FROM(IN1) TO(T1) USING(CTL1) COPY FROM(IN2) TO(T1) USING(CTL2) COPY FROM(IN3) TO(T1) USING(CTL3) SELECT FROM(T1) TO(OUT1) ON(1,22,CH) NODUPS USING(CTL4) //CTL1CNTL DD * OUTREC FIELDS=(1,3,C'X',1,10,8X) //CTL2CNTL DD * OUTREC FIELDS=(1,3,C'Y',1,14,4X) //CTL3CNTL DD * OUTREC FIELDS=(1,3,C'Z',1,18) //CTL4CNTL DD * SORT FIELDS=(1,3,ZD,A) //*
zaphany

New User

Joined: 16 May 2006
Posts: 11

Posted: Mon Jul 31, 2006 10:37 am    Post subject: Re: question about Sorting multiple files

haha, i think i can make it more simple....

 Code: //SORT3 EXEC PGM=ICETOOL,COND=(5,LE) //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSABOUT DD SYSOUT=* //SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(10,10)) //SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(10,10)) //SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(10,10)) //SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(10,10)) //IN1 DD * 123AAABBBC 345BBBCCCD 456CCCEEEF //IN2 DD * 123FFF111WWWWW 234GGG111RRRRR 456HHH111TTTTT 345JJJEEEZZZZZ //IN3 DD * 123FFF111QQQQQRRRR 111GGG555RRRRRFFFF 333HHH777TTTFFPPPP 345JJJEEEZZZSSSSSS //OUT1 DD DSN=file.name, // DISP=(NEW,CATLG,DELETE), // DCB=(RECFM=FB,LRECL=22,BLKSIZE=0), // SPACE=(TRK,(5,5),RLSE) //T1 DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA //TOOLIN DD * COPY FROM(IN1) TO(T1) USING(CTL1) COPY FROM(IN2) TO(T1) USING(CTL2) COPY FROM(IN3) TO(T1) USING(CTL3) COPY FROM(T1) TO(OUT1) USING(CTL4) //CTL1CNTL DD * OUTREC FIELDS=(1,3,C'X',1,10,8X) //CTL2CNTL DD * OUTREC FIELDS=(1,3,C'Y',1,14,4X) //CTL3CNTL DD * OUTREC FIELDS=(1,3,C'Z',1,18) //CTL4CNTL DD * SORT FIELDS=(1,3,ZD,A) //*

anyways...it is fun...
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Question about dataset sequence numbe... harisukumaran JCL & VSAM 23 Tue May 29, 2018 9:31 am Splitting one row into multiple Rows ... Rajan Moorthy DFSORT/ICETOOL 9 Mon May 14, 2018 10:58 pm Comparing two sequential files Mohan Kothakota COBOL Programming 14 Mon Apr 16, 2018 6:35 pm SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am write multiple lines in PS file in cobol Balu5491 COBOL Programming 7 Wed Mar 07, 2018 10:27 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us