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
 
Please provide the sort card for this

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

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Nov 14, 2007 6:18 pm    Post subject: Please provide the sort card for this
Reply with quote

Hi all,


I have a FB file with record length 80 like

Code:
011 0000000000000000000
012 1111111111111111111
013 2222222222222222222
014 3333333333333333333
015 4444444444444444444
016 5555555555555555555
017 6666666666666666666
018 7777777777777777777
019 8888888888888888888


Here first three field contain some key value & it's unique per record
Now i want the output

Code:
020 1111111111111111111
021 2222222222222222222
022 3333333333333333333
023 4444444444444444444
024 5555555555555555555
025 6666666666666666666
026 7777777777777777777
027 8888888888888888888


Means we are taking the higest key value which is 019 in this case adding
1 for first row 2 for second row...
Please provide the sort card for this.
Back to top
View user's profile Send private message

krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Nov 14, 2007 8:16 pm    Post subject:
Reply with quote

guptae
Here is the SORT solution for your problem
Code:
//*******************************************************               
//STEP1    EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                         
011 0000000000000000000                                                 
012 1111111111111111111                                                 
013 2222222222222222222                                                 
014 3333333333333333333                                                 
015 4444444444444444444                                                 
016 5555555555555555555                                                 
017 6666666666666666666                                                 
018 7777777777777777777                                                 
019 8888888888888888888                                                 
/*                                                                     
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  SORT FIELDS=(1,3,ZD,D)                                               
  OUTFIL REMOVECC,ENDREC=1,                                             
         BUILD=(1,3,ZD,ADD,+1,M11,LENGTH=3,5:19C'1',80:X,/,             
                1,3,ZD,ADD,+2,M11,LENGTH=3,5:19C'2',80:X,/,             
                1,3,ZD,ADD,+3,M11,LENGTH=3,5:19C'3',80:X,/,             
                1,3,ZD,ADD,+4,M11,LENGTH=3,5:19C'4',80:X,/,             
                1,3,ZD,ADD,+5,M11,LENGTH=3,5:19C'5',80:X,/,             
                1,3,ZD,ADD,+6,M11,LENGTH=3,5:19C'6',80:X,/,             
                1,3,ZD,ADD,+7,M11,LENGTH=3,5:19C'7',80:X,/,             
                1,3,ZD,ADD,+8,M11,LENGTH=3,5:19C'8',80:X)               
/*                                                                     


SORTOUT
Code:
020 1111111111111111111
021 2222222222222222222
022 3333333333333333333
023 4444444444444444444
024 5555555555555555555
025 6666666666666666666
026 7777777777777777777
027 8888888888888888888
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Nov 14, 2007 10:08 pm    Post subject:
Reply with quote

Hi krisprems,

Thanks for your reply...But my dataset contain 3.5 million records so i cant follow ur approach..
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 Nov 14, 2007 10:29 pm    Post subject:
Reply with quote

I think Ekta did not describe what was needed very well. I'm guessing that the records do NOT necessarily contain repeating numbers and that the 020 ... should be overlaid on the existing records whatever they contain (Ekta does not show the 0s record for output but should have).

To illustrate what I think is wanted, the input could be something like this:

Code:

011 A000000001AAAAAAAAA
012 B000000005BBBBBBBBB
013 B000000006CCCCCCCCC
014 B000000003DDDDDDDDD
015 CCCCCCCCCCCCCC00002
016 D000000002555555555
017 EEEEEEEEFFFFFFFFFFF
018 F000000000000000000
019 GGGGGGGGGGGGHHHHHHH


Krisprems solution would give this output for that input and every other similar set of input:

Code:

020 1111111111111111111
021 2222222222222222222
022 3333333333333333333
023 4444444444444444444
024 5555555555555555555
025 6666666666666666666
026 7777777777777777777
027 8888888888888888888


But I'm guessing that the output for this input should actually be:

Code:

020 A000000001AAAAAAAAA
021 B000000005BBBBBBBBB
022 B000000006CCCCCCCCC
023 B000000003DDDDDDDDD
024 CCCCCCCCCCCCCC00002
025 D000000002555555555
026 EEEEEEEEFFFFFFFFFFF
027 F000000000000000000
028 GGGGGGGGGGGGHHHHHHH


Here's a DFSORT/ICETOOL job to give that output:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN   DD *
011 A000000001AAAAAAAAA
012 B000000005BBBBBBBBB
013 B000000006CCCCCCCCC
014 B000000003DDDDDDDDD
015 CCCCCCCCCCCCCC00002
016 D000000002555555555
017 EEEEEEEEFFFFFFFFFFF
018 F000000000000000000
019 GGGGGGGGGGGGHHHHHHH
/*
//OUT  DD SYSOUT=*
//TOOLIN   DD *
COPY FROM(IN) USING(CTL1)
COPY FROM(IN) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC BUILD=(1,3,ZD,ADD,+1,EDIT=(TTT))
  OUTFIL FNAMES=CTL2CNTL,REMOVECC,NODETAIL,
    BUILD=(80X),
    TRAILER1=('  INREC OVERLAY=(SEQNUM,3,ZD,START=',
      MAX=(1,3,ZD,EDIT=(TTT)),C')')
/*
//CTL2CNTL DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)


Note that this approach will work for any number of records.

Ekta - please clarify what it is you do want.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Thu Nov 15, 2007 6:54 pm    Post subject:
Reply with quote

Hi Frank,

Thanks a ton...
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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
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

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