View previous topic :: View next topic
|
Author |
Message |
sanil m
New User
Joined: 24 Aug 2007 Posts: 38 Location: chennai
|
|
|
|
Hi,
I have a requirement to split file after identifying a particular record in the Input.
To explain in detail.
Input file :
SUMMREPT AAAAAAA
BBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCC
DDDDDDDDDDDDDDD
EEEEEEEEEEEEEEEEE
SUMMREPT FFFFFFFFF
GGGGGGGGGGGGGGG
BBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCC
SUMMREPT CCCCCCC
AAAAAAAAAAAAAAAAA
This need to be split into 3 files whenever the character 'SUMMREPT' is identified in column 1 - 8.
Output file 1 :
SUMMREPT AAAAAAA
BBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCC
DDDDDDDDDDDDDDD
EEEEEEEEEEEEEEEEE
Output file 2 :
SUMMREPT FFFFFFFFF
GGGGGGGGGGGGGGG
BBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCC
Output file 3 :
SUMMREPT CCCCCCC
AAAAAAAAAAAAAAAAA
.
Any help to have this done through SORT cards is highly appreciated. Thanks ! |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
You did not mention it but I presume SYNCSORT? |
|
Back to top |
|
|
sanil m
New User
Joined: 24 Aug 2007 Posts: 38 Location: chennai
|
|
|
|
Hello Nic,
Yes, Using Sort Utilities. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Quote: |
Yes, Using Sort Utilities. |
pretty useless reply....
we wantto know if You are using
SYNCSORT ==> WER... messages
DFSORT ==> ICE... messages
in any case post the output of
Code: |
****** ***************************** Top of Data ******************************
000001 //<appropriate jobcard>
000002 //*
000003 //*
000004 //S EXEC PGM=SORT
000005 //SYSOUT DD SYSOUT=*
000006 //SORTIN DD *
000007 DUMMY
000008 //SORTOUT DD SYSOUT=*,
000009 // DCB=(RECFM=FB,LRECL=80)
000010 //SYSIN DD *
000011 OPTION COPY
****** **************************** Bottom of Data **************************** |
so we can see the level of the sort product You are using |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
anyway the issue has been debated to death...
since You lazily did not care to search the forum
I am going to save some of Your precious time posting some control cards
from which using Your neurons You will be able to deduce the right solutiopn for Your need
Code: |
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,8,CH,EQ,C'SUMREPT'),
PUSH=(81:ID=2)) <== works for 99 groups
OUTFIL FNAMES=OUT01,INCLUDE=(81,2,CH,EQ,C'01') BUILD=(1,80)
OUTFIL FNAMES=OUT02,INCLUDE=(81,2,CH,EQ,C'02') BUILD=(1,80)
...
OUTFIL FNAMES=OUT99,INCLUDE=(81,2,CH,EQ,C'99') BUILD=(1,80) |
|
|
Back to top |
|
|
sanil m
New User
Joined: 24 Aug 2007 Posts: 38 Location: chennai
|
|
|
|
@ Enrico,
Using SYNCSORT.
From the step which you've asked to execute.
I hope the below information is ok.
SYNCSORT FOR Z/OS 1.4.0.1R
C) 2010 SYNCSORT INC.
Let me know if i'm missing something. Thanks ! |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
the snippet I posted was tested for dfsort, should work also for syncsort. |
|
Back to top |
|
|
sanil m
New User
Joined: 24 Aug 2007 Posts: 38 Location: chennai
|
|
|
|
@ Enrico.
Thanks a lot. This worked correctly.
P.S : I did some search before posting here. I wasn't aware of the GROUP keyword. But anyway thanks for replying to me with patience. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If you go with three OUTFILs, what happens if you get a fourth SUMMREPT?
If this can happen and you want it in the third output dataset, then you can code SAVE for the third OUTFIL.
If this may happen and you want it in a fourth dataset, then code a fourth OUTFIL with SAVE.
In DFSORT, anyway :-)
If it happens, another one appearing, with three plain OUTFIL INCLUDE then you may just loose the data or find it on SORTOUT if specified. |
|
Back to top |
|
|
sanil m
New User
Joined: 24 Aug 2007 Posts: 38 Location: chennai
|
|
|
|
Thanks Bill for the Information. |
|
Back to top |
|
|
|