Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

question about Sorting multiple files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
zaphany

New User


Joined: 16 May 2006
Posts: 11

PostPosted: Fri Jul 28, 2006 6:05 pm    Post subject: question about Sorting multiple files
Reply with quote

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!
Back to top
View user's profile Send private message

sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Sat Jul 29, 2006 12:06 am    Post subject:
Reply with quote

Hi,
Please provide sample data.The problem is little bit confusing.


Thank you
Krishy
Back to top
View user's profile Send private message
zaphany

New User


Joined: 16 May 2006
Posts: 11

PostPosted: Mon Jul 31, 2006 9:42 am    Post subject: Re: question about Sorting multiple files
Reply with quote

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)
//*
Back to top
View user's profile Send private message
zaphany

New User


Joined: 16 May 2006
Posts: 11

PostPosted: Mon Jul 31, 2006 10:37 am    Post subject: Re: question about Sorting multiple files
Reply with quote

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...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us