View previous topic :: View next topic
|
Author |
Message |
thala_ds
New User
Joined: 05 Jun 2012 Posts: 18 Location: India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
thala_ds
New User
Joined: 05 Jun 2012 Posts: 18 Location: India
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
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 |
|
|
thala_ds
New User
Joined: 05 Jun 2012 Posts: 18 Location: India
|
|
|
|
Yes Pandora. Exactly. I need the output as the same you have given. Thanks for your reply.
Regards,
thala_ds |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Code: |
//SYSIN DD *
SORT FIELDS=(24,25,CH,A)
OUTFIL REMOVECC,
SECTIONS=(24,25,
TRAILER3=(80:X))
/*
|
|
|
Back to top |
|
|
thala_ds
New User
Joined: 05 Jun 2012 Posts: 18 Location: India
|
|
|
|
Wow.. Thanks Escapa.. It worked perfectly. Thanks for your help.
Regards,
thala_ds |
|
Back to top |
|
|
|