IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

can the following be achieved using SYNCSORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Tue Jun 15, 2010 7:56 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jun 15, 2010 8:03 pm
Reply with quote

Then please post in the JCL forum for SYNCSORT questions.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jun 15, 2010 8:59 pm
Reply with quote

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
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Tue Jun 15, 2010 11:50 pm
Reply with quote

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
View user's profile Send private message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Wed Jun 16, 2010 8:51 am
Reply with quote

thanks for the reply:) and does this can be refined ......
Back to top
View user's profile Send private message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Wed Jun 16, 2010 9:22 am
Reply with quote

i meant that in an other sort to represent the same...
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jun 16, 2010 10:58 am
Reply with quote

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
View user's profile Send private message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Wed Jun 16, 2010 1:44 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jun 16, 2010 1:50 pm
Reply with quote

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
View user's profile Send private message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Wed Jun 16, 2010 2:28 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jun 16, 2010 2:35 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Jun 16, 2010 6:04 pm
Reply with quote

And why not show a exhaustive list of input and expected output records, with all the rules well-defined.
Back to top
View user's profile Send private message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Thu Jun 17, 2010 9:31 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 17, 2010 9:39 am
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Jun 17, 2010 10:51 am
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 17, 2010 4:18 pm
Reply with quote

this is a typical Tecnokrat thread.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Syncsort "Y2C" Function SYNCSORT 1
No new posts Arithmetic division using Syncsort SYNCSORT 6
Search our Forums:

Back to Top