View previous topic :: View next topic
|
Author |
Message |
prathap_ts Warnings : 1 New User
Joined: 07 May 2005 Posts: 9 Location: Duluth, US
|
|
|
|
input file
col1 col2
12345 11111
12345 11111
12345 22222
12345 33333
12345 33333
54321 77777
54321 77777
54321 33333
67890 22222
67890 44444
67890 88888
98765 99999
98765 99999
in col3, i want to display the occurance of col1 for every change in col2 as
mentioned below
output file
col1 col2 col3
12345 11111 1
12345 22222 2
12345 33333 3
54321 77777 1
54321 33333 2
67890 22222 1
67890 44444 2
67890 88888 3
98765 99999 1 |
|
Back to top |
|
|
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
Hi,
You may want to refer RESTART of SEQNUM from 'DFSORT application programming guide'.
Quote: |
RESTART specifies that DFSORT is to restart the sequence number at the starting value (START=j) when the binary value for the specified OUTFIL input field or parsed input field changes. This allows you to sequence each set of records with the same value (that is, duplicate records) separately. For example: Without RESTART, if you had six OUTFIL input records with ’A’, ’A’, ’A’, ’B’, ’B’ and ’C’, respectively, in position 1, the output records would be given the sequence numbers 1, 2, 3, 4, 5 and 6. But with RESTART=(1,1), the output records are given the sequence numbers 1, 2, 3, 1, 2 and 1; DFSORT restarts at the starting value (1, by default) when the input value at position 1 changes from ’A’ to ’B’ and again when it changes from ’B’ to ’C’. |
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
parthap_ts,
You can use a DFSORT job like the following to do what you asked for:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
12345 11111
12345 11111
12345 22222
12345 33333
12345 33333
54321 77777
54321 77777
54321 33333
67890 22222
67890 44444
67890 88888
98765 99999
98765 99999
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(17:SEQNUM,3,FS,RESTART=(1,13))
OUTFIL OMIT=(17,3,ZD,GT,1),
OVERLAY=(17:SEQNUM,3,FS,RESTART=(1,5))
/*
|
|
|
Back to top |
|
|
prathap_ts Warnings : 1 New User
Joined: 07 May 2005 Posts: 9 Location: Duluth, US
|
|
|
|
hey farnk... its works thanks
u too senthil.
bfn
Prathap TS. |
|
Back to top |
|
|
prathap_ts Warnings : 1 New User
Joined: 07 May 2005 Posts: 9 Location: Duluth, US
|
|
|
|
there is a little change in the input structure
RCFMT - FB, LRECL - 80
F1 PIC S9(9) USAGE COMP.
F2 PIC S9(9) USAGE COMP.
F3 PIC S9(4) USAGE COMP.
F4 PIC S9(9) USAGE COMP.
input
F1 --F2--- F3 --F4--
10 12345 1 11111
10 12345 1 22222
10 12345 1 33333
10 54321 1 77777
10 54321 1 33333
10 67890 1 22222
10 67890 1 44444
10 67890 1 88888
10 98765 1 99999
output
F1 --F2--- F3 --F4--
10 12345 1 11111
10 12345 2 22222
10 12345 3 33333
10 54321 1 77777
10 54321 2 33333
10 67890 1 22222
10 67890 2 44444
10 67890 3 88888
10 98765 1 99999
for the above req i tried with the sysin st
Code: |
SYSIN :
OPTION COPY
INREC OVERLAY=(9:SEQNUM,4,BI,RESTART=(5,10))
OVERLAY=(9:SEQNUM,4,BI,RESTART=(5,4))
* |
But getting error like
NO KEYWORDS FOUND ON CONTROL STATEMENT |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
That's a Syncsort message, so you're using Syncsort, not DFSORT. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
I'm moving this thread to the JCL Forum. Please post future questions on Syncsort there. |
|
Back to top |
|
|
prathap_ts Warnings : 1 New User
Joined: 07 May 2005 Posts: 9 Location: Duluth, US
|
|
|
|
frank then let me know how to do with ICETOOL or ICEMAN
hope i mentioned this in subject also... |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Frank Yaeger wrote: |
That's a Syncsort message, so you're using Syncsort, not DFSORT. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
I'm moving this thread to the JCL Forum. Please post future questions on Syncsort there. |
prathap_ts,
Which part of the above message dint you understand?
Being able WORK with "ICEMAN" and "ICETOOL" in a SyncSort shop does not mean that you have DFSORT unless your shop has both the products installed. These will invoke the modules SORT/SYNCSORT and SYNCTOOL respectively in your shop. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
If the job Frank provided worked, why did you not continue in the same way?
Your sort control info is somewhat different than the original. . .
Suggest you also learn to use the "Code" tag to make jcl, code, and data more readable |
|
Back to top |
|
|
prathap_ts Warnings : 1 New User
Joined: 07 May 2005 Posts: 9 Location: Duluth, US
|
|
|
|
arun
if u know the answer for requirement either in syncsort or dfsort
then post it here and don't bother abt the sort tools.
if u can move the post accordingly...
dick
i mentioned clearly that 'there is a little change in the input structure'
hope here i'm looking for an answer for my requirement |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
prathap_ts,
Quote: |
arun
if u know the answer for requirement either in syncsort or dfsort
then post it here |
Already there's a working solution posted above, you just need to copy it and make a few changes. It's not working for you because instead of changing the field format, you have discovered your own syntax. So correct your syntax and re-run your job.
Quote: |
don't bother abt the sort tools |
I am least bothered about your "sort tools". But you should be aware which product/tool you have and ask for a solution which works on your product.
Quote: |
if u can move the post accordingly |
If you had bothered to read the last post made by Frank, you would n't have made this statement.
This topic is already in JCL forum since "Wed Jun 10, 2009 9:31 pm" |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Thanks Arun, you put that in a far more user friendly way than I would have |
|
Back to top |
|
|
|