IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SORT - Adding blank line after every key change


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
thala_ds

New User


Joined: 05 Jun 2012
Posts: 18
Location: India

PostPosted: Mon Dec 17, 2012 3:58 pm
Reply with quote

Hi,

I have a requirement to add a blank line after every key changes in a record.

My input file will look like below :
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7
124106587 ABC 011  SAME CORP/STREAM
124106588 ABC 011  SAME CORP/STREAM
124106592 DEF 012  ACCOUNTS IN TEAM BUT NOT IN PLAN   
124108888 HIJ 013  SAME ACCOUNT MAPPED           
124200011 ERT 014  SAME ACCOUNT MAPPED       


My key field will be from 24 and length is 25 bytes.
I have tried the below sort card but it was not inserting a blank line after key change.

Code:
SORT FIELDS=(24,25,CH,A)
OUTFIL REMOVECC,
SECTIONS=(24,25,SKIP=1L)


File LRECL = 96 and RECFM = FB
Can anyone please advise me if anything is wrong with my sort card?

Regards,
thala_ds

Code'd and de-mangled from non-proportional "lining-up"
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Dec 17, 2012 4:08 pm
Reply with quote

Please use the Code tags.

Is your sample data correct? It looks like your "key" starts in the middle of something.

What output did you get when you ran those Sort control-cards?
Back to top
View user's profile Send private message
thala_ds

New User


Joined: 05 Jun 2012
Posts: 18
Location: India

PostPosted: Mon Dec 17, 2012 4:11 pm
Reply with quote

Thanks Bill for your quick reply.

My key field will be from 24 and length is 25 bytes. If was changed while copy pasting. sorry abt that.

I am getting the same output as the input file i have given. I don't see any changes after running the job. No blanks lines were found in the output.

Regards,
thala_ds
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Mon Dec 17, 2012 4:33 pm
Reply with quote

I agree with Bill

24,25 doesnt look like a key field may be you can call it as a description field

so need output as something like this

Code:
124106587 ABC 011  SAME CORP/STREAM
124106588 ABC 011  SAME CORP/STREAM

124106592 DEF 012  ACCOUNTS IN TEAM BUT NOT IN PLAN   

124108888 HIJ 013  SAME ACCOUNT MAPPED           
124200011 ERT 014  SAME ACCOUNT MAPPED 

??
Back to top
View user's profile Send private message
thala_ds

New User


Joined: 05 Jun 2012
Posts: 18
Location: India

PostPosted: Mon Dec 17, 2012 4:42 pm
Reply with quote

Yes Pandora. Exactly. I need the output as the same you have given. Thanks for your reply.


Regards,
thala_ds
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Dec 17, 2012 4:57 pm
Reply with quote

Code:

//SYSIN    DD  *
  SORT FIELDS=(24,25,CH,A)
  OUTFIL REMOVECC,
  SECTIONS=(24,25,
    TRAILER3=(80:X))
/*
Back to top
View user's profile Send private message
thala_ds

New User


Joined: 05 Jun 2012
Posts: 18
Location: India

PostPosted: Mon Dec 17, 2012 5:04 pm
Reply with quote

Wow.. Thanks Escapa.. It worked perfectly. Thanks for your help.

Regards,
thala_ds
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
Search our Forums:

Back to Top