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
 

 

SORT - Adding blank line after every key change

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: SORT - Adding blank line after every key change
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7230

PostPosted: Mon Dec 17, 2012 4:08 pm    Post subject: Reply to: SORT - Adding blank line after every key change
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    Post subject:
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

Moderator


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

PostPosted: Mon Dec 17, 2012 4:33 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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