| Author |
Message |
vinodkrs
New User
Joined: 25 Mar 2008 Posts: 10 Location: india
|
|
|
|
I am using ICETOOL to sort a particular file
currently I am sorting using the below 8 parms. Can we reduce the number of parms by merging some sort cards.
parm1-TOOLIN
COPY FROM(IN1) TO(OUT1) USING(CPY1)
SORT FROM(IN1) TO(OUT1) USING(SRT1)
SORT FROM(IN1) TO(OUT1) USING(SRT2)
SORT FROM(IN1) TO(OUT1) USING(SRT3)
SORT FROM(IN1) TO(OUT1) USING(SRT4)
SORT FROM(IN1) TO(OUT1) USING(SRT5)
COPY FROM(IN1) TO(OUT1) USING(CPY2)
parm2-CPY1
INCLUDE COND=(1,1,BI,EQ,X'00')
parm3-CPY2
INCLUDE COND=(1,1,BI,EQ,X'FF')
parm4-SRT1
SORT FIELDS=(1,80,CH,A,
81,7,UFF,A,
88,8,CH,A,
104,47,CH,A)
INCLUDE COND=(2048,2,CH,EQ,C'01')
parm5-SRT2
SORT FIELDS=(1,80,CH,A,
81,7,UFF,A,
88,8,CH,A,
112,39,CH,A)
INCLUDE COND=(2048,2,CH,EQ,C'02')
parm6-SRT3
SORT FIELDS=(1,66,CH,A,
67,5,UFF,A,
78,73,CH,A)
INCLUDE COND=(2048,2,CH,EQ,C'03')
parm7-SRT4
SORT FIELDS=(1,33,CH,A,
34,4,UFF,A,
38,21,CH,A,
63,88,CH,A)
INCLUDE COND=(2048,2,CH,EQ,C'04')
parm8-SRT5
SORT FIELDS=(1,289,CH,A,
298,3,CH,A)
INCLUDE COND=(2048,2,CH,EQ,C'05') |
|
| Back to top |
|
 |
References
|
Posted: Wed Apr 16, 2008 1:27 pm Post subject: Re: Merging sort cards using ICETOOL |
 |
|
|
 |
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 1003 Location: At my desk
|
|
|
|
Will any of the sorted records have the 1,1,BI EQ X'00' or X'FF'? Do they represent headers and/or trailers?
If these are trailers, are there only one each or are there many creating groups of header/trailered detail records?
I would think IFTHEN ON statements could build the unique sortfields and append the original data onto the common length key and produce the output in a single pass..... |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 3804 Location: San Jose, CA
|
|
|
|
vinodkrs,
It's not clear what you're trying to do. I don't have time to try to figure out what you want from all of those operators and control statements.
Your TO ddname is OUT1 for all of the operators. Is OUT1 a MOD data set that will contain the different versions of the input file you're creating? Or are you just showing what you'd like to get in one output data set?
You really need to step back and explain what you're trying to do. Show a good example of your input records (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of the relevant fields. |
|
| Back to top |
|
 |
vinodkrs
New User
Joined: 25 Mar 2008 Posts: 10 Location: india
|
|
|
|
Parm 2 and 3 contains header and trailer respectively. I have to include the same header and trailer as my input file to the output file. OUT1 is the DD name for my output file. It will contain the following
header(CPY1)
records sorted based on SRT1(parm4)
records sorted based on SRT2(parm5)
records sorted based on SRT3(parm6)
records sorted based on SRT4(parm7)
records sorted based on SRT5(parm8)
trailer(CPY2)
Now i am getting the perfect result, but i want to reduce the number of parms. Is there any way to reduce the number of parms? |
|
| Back to top |
|
 |
Skolusu
DFSORT Developer
Joined: 07 Dec 2007 Posts: 109 Location: San Jose
|
|
|
|
Vinodkrs,
I think we can club all those control cards into 1 single pass. In order to help you with a single pass solution I need the following details.
1. What is the LRECL and RECFM of the input dataset
2. Show me an example of the UFF fields on each record type. ie. type 01 & 02 has 7 bytes of uff data and type 03 has 5 bytes of uff data and type 04 has 4 bytes of uff data. What do the values for these fields look like? |
|
| Back to top |
|
 |
vinodkrs
New User
Joined: 25 Mar 2008 Posts: 10 Location: india
|
|
|
|
Hi,
The LRECL is 2900 and the RECFM is FB.
UFF fields are noyhing but amount fields. eg: 10000,-34900,768900,-657000etc.. |
|
| Back to top |
|
 |
Skolusu
DFSORT Developer
Joined: 07 Dec 2007 Posts: 109 Location: San Jose
|
|
|
|
vinodkrs,
The uff fields you show have sign in them and you dont consider the sign when sorting? If that is what you want then here is a DFSORT JCL will give you the desired results. The basic idea is to add all the sort fields for all conditions at the end of every record with record identifier using IFTHEN and then sort them as a single field and later on remove that extra bytes using OUTREC.
| Code: |
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=your input 2900 lrecl fb file,
// DISP=SHR
//SORTOUT DD DSN=your output sorted file,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
OPTION EQUALS
INREC IFTHEN=(WHEN=(1,1,BI,EQ,X'00'),OVERLAY=(2901:C'00')),
IFTHEN=(WHEN=(1,1,BI,EQ,X'FF'),OVERLAY=(2901:C'09')),
IFTHEN=(WHEN=(2048,2,CH,EQ,C'01'),
OVERLAY=(2901:C'01',1,80,81,7,UFF,M11,LENGTH=7,
88,8,104,47,150X)),
IFTHEN=(WHEN=(2048,2,CH,EQ,C'02'),
OVERLAY=(2901:C'02',1,80,81,7,UFF,M11,LENGTH=7,
88,8,112,39,158X)),
IFTHEN=(WHEN=(2048,2,CH,EQ,C'03'),
OVERLAY=(2901:C'03',1,66,67,5,UFF,M11,LENGTH=5,
78,73,148X)),
IFTHEN=(WHEN=(2048,2,CH,EQ,C'04'),
OVERLAY=(2901:C'04',1,33,34,4,UFF,M11,LENGTH=4,
38,21,63,88,146X)),
IFTHEN=(WHEN=(2048,2,CH,EQ,C'05'),
OVERLAY=(2901:C'05',1,289,298,3))
SORT FIELDS=(2901,294,BI,A)
OUTREC BUILD=(1,2900)
//* |
Hope this helps...
Cheers |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 3804 Location: San Jose, CA
|
|
|
|
vinodkrs,
| Quote: |
| UFF fields are noyhing but amount fields. eg: 10000,-34900,768900,-657000etc.. |
UFF mean unsigned free format. UFF will ignore the signs so +10 will be treated the same as -10.
Is that what you really want? Or do you want to use SFF (signed free form) so it will take the signs into account? |
|
| Back to top |
|
 |
vinodkrs
New User
Joined: 25 Mar 2008 Posts: 10 Location: india
|
|
|
|
Hi Frank,
I need to ignore the signs. So I need to use the UFF . |
|
| Back to top |
|
 |
vinodkumarrs
New User
Joined: 31 Mar 2008 Posts: 2 Location: india
|
|
|
|
| This logic is working excellently. Thank you very much. |
|
| Back to top |
|
 |
|
|
|