Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Merging sort cards using ICETOOL

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

New User


Joined: 25 Mar 2008
Posts: 10
Location: india

PostPosted: Wed Apr 16, 2008 1:27 pm    Post subject: Merging sort cards using ICETOOL
Reply with quote

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

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Apr 16, 2008 7:16 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Apr 16, 2008 10:45 pm    Post subject:
Reply with quote

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
View user's profile Send private message
vinodkrs

New User


Joined: 25 Mar 2008
Posts: 10
Location: india

PostPosted: Wed Apr 30, 2008 1:06 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Apr 30, 2008 10:19 pm    Post subject:
Reply with quote

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
View user's profile Send private message
vinodkrs

New User


Joined: 25 Mar 2008
Posts: 10
Location: india

PostPosted: Wed May 07, 2008 6:07 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed May 07, 2008 9:14 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed May 07, 2008 10:11 pm    Post subject:
Reply with quote

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
View user's profile Send private message
vinodkrs

New User


Joined: 25 Mar 2008
Posts: 10
Location: india

PostPosted: Thu May 08, 2008 10:04 am    Post subject:
Reply with quote

Hi Frank,

I need to ignore the signs. So I need to use the UFF .
Back to top
View user's profile Send private message
vinodkumarrs

New User


Joined: 31 Mar 2008
Posts: 8
Location: india

PostPosted: Fri May 09, 2008 11:06 pm    Post subject:
Reply with quote

This logic is working excellently. Thank you very much.
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us