|
View previous topic :: View next topic
|
| Author |
Message |
tecnokrat Warnings : 1 Active User

Joined: 22 May 2009 Posts: 160 Location: Bangalore
|
|
|
|
I have a file with below details
Trigger-col program
100 AA,AB
200 AC
300 AC,AB,AA
The below output I need to acheive using SYNCSORT.
DFSORT is not on my machine.
100 AA
100 AB
200 AC
300 AC
300 AB
300 AA
Thanks in advance |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
| Then please post in the JCL forum for SYNCSORT questions. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
If a topic is posted in the wrong part of the forum and it is relocated (as this one has been), the topic will be "gone" if the poster looks in the original part of the forum.
It will appear to have been deleted. . . |
|
| Back to top |
|
 |
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
If the maximum number of records produced from a single input record is 3, then here is a SyncSort for z/OS job that will produce the requested output:
| Code: |
//STEP1 EXEC PGM=SORT
//SORTIN DD *
100 AA,AB
200 AC
300 AC,AB,AA
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL IFTHEN=(WHEN=(7,6,CH,EQ,C' '),BUILD=(1,6)),
IFTHEN=(WHEN=(10,3,CH,EQ,C' '),BUILD=(1,6,/,1,4,8,2)),
IFTHEN=(WHEN=NONE,BUILD=(1,6,/,1,4,8,2,/,1,4,11,2))
/* |
|
|
| Back to top |
|
 |
tecnokrat Warnings : 1 Active User

Joined: 22 May 2009 Posts: 160 Location: Bangalore
|
|
|
|
| thanks for the reply:) and does this can be refined ...... |
|
| Back to top |
|
 |
tecnokrat Warnings : 1 Active User

Joined: 22 May 2009 Posts: 160 Location: Bangalore
|
|
|
|
| i meant that in an other sort to represent the same... |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10903 Location: italy
|
|
|
|
You asked a question, You got an answer from the SYNCSORT guru
what is the reason to ask for a different solution ? |
|
| Back to top |
|
 |
tecnokrat Warnings : 1 Active User

Joined: 22 May 2009 Posts: 160 Location: Bangalore
|
|
|
|
| The above query is at a static level and can that be at a dynamically in the sense the SYNCSORT above is referencing on the static positions |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
| You really need to express your question / comment in a way which can be easily understood. Give examples if required. Show clearly what it is that you want to have answered. |
|
| Back to top |
|
 |
tecnokrat Warnings : 1 Active User

Joined: 22 May 2009 Posts: 160 Location: Bangalore
|
|
|
|
The below file with the input as
Trigger-col program
100 AA,AB
200 AC
300 AC,AB,AA
now the program column can have two programs or three or any number base on this the program whcih is a 2 byte field we have to segregate the trigger-col.
for eg: for the second run
Trigger-col program
100 AA,AB,AC
200 AC,AD,AB
300 AC |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
OK, so what happened when you tried the new input file you have shown with the solution given to you by Alissa.
What effort have YOU made to amend the sort job to cater for more possibilities, and what problems did you encounter. I'm not a great user of either sort product, but the solution does not seem overly difficult, even for me.
Please remember that this is a HELP forum rather than a DO IT FOR ME forum. People help on these forum do so because they want to, and I am sure that they would like to see a lot more effort from posters in trying to resolve their problems before posting. |
|
| Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
| And why not show a exhaustive list of input and expected output records, with all the rules well-defined. |
|
| Back to top |
|
 |
tecnokrat Warnings : 1 Active User

Joined: 22 May 2009 Posts: 160 Location: Bangalore
|
|
|
|
hi,
i tried with the logic mentioned by allisa.
| Code: |
//STEP1 EXEC PGM=SORT
//SORTIN DD *
100 AA,AB
200 AC
300 AC,AB,AA
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL IFTHEN=(WHEN=(7,6,CH,EQ,C' '),BUILD=(1,6)),
IFTHEN=(WHEN=(10,3,CH,EQ,C' '),BUILD=(1,6,/,1,4,8,2)),
IFTHEN=(WHEN=NONE,BUILD=(1,6,/,1,4,8,2,/,1,4,11,2))
/* |
say the above condition will work fine when the programs are a limited one but the programs may occur for a 15 occurences or a one occurences.
like say if my code is as below
| Code: |
//STEP1 EXEC PGM=SORT
//SORTIN DD *
100 AA,AB,AD,AG
200 AC,AQ,AU,AA
300 AC
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL IFTHEN=(WHEN=(7,6,CH,EQ,C' '),BUILD=(1,6)),
IFTHEN=(WHEN=(10,3,CH,EQ,C' '),BUILD=(1,6,/,1,4,8,2)),
IFTHEN=(WHEN=NONE,BUILD=(1,6,/,1,4,8,2,/,1,4,11,2))
/* |
The output would fetch u only the values at that particular positions as mentioned in our syncsort. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Please re-read what Expat has posted:
| Quote: |
| Please remember that this is a HELP forum rather than a DO IT FOR ME forum. |
When one has been given a solution, one should work on expanding it to do more themself. . .
You need to define the rules and then implement the code.
Keep in mind that you will most likely need additional "solutions" as you change the requirements. |
|
| Back to top |
|
 |
CICS Guy
Senior Member

Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
| tecnokrat wrote: |
| now the program column can have two programs or three or any number base on this the program whcih is a 2 byte field we have to segregate the trigger-col. |
Yet none of your examples show more than three.
Does "any number base" mean there might be more?
If so, add more"IFTHEN=(WHEN=(" statements until you have accounted for the maximun expected terms. |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
| this is a typical Tecnokrat thread. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|