Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

can the following be achieved using SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 158
Location: Bangalore

PostPosted: Tue Jun 15, 2010 7:56 pm    Post subject: can the following be achieved using SYNCSORT
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: 8593
Location: Back in jolly old England

PostPosted: Tue Jun 15, 2010 8:03 pm    Post subject:
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

Site Director


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

PostPosted: Tue Jun 15, 2010 8:59 pm    Post subject:
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: 500
Location: USA

PostPosted: Tue Jun 15, 2010 11:50 pm    Post subject:
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: 158
Location: Bangalore

PostPosted: Wed Jun 16, 2010 8:51 am    Post subject:
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: 158
Location: Bangalore

PostPosted: Wed Jun 16, 2010 9:22 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Wed Jun 16, 2010 10:58 am    Post subject: Reply to: can the following be achieved using SYNCSORT
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: 158
Location: Bangalore

PostPosted: Wed Jun 16, 2010 1:44 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 16, 2010 1:50 pm    Post subject:
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: 158
Location: Bangalore

PostPosted: Wed Jun 16, 2010 2:28 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 16, 2010 2:35 pm    Post subject:
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

Senior Member


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

PostPosted: Wed Jun 16, 2010 6:04 pm    Post subject:
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: 158
Location: Bangalore

PostPosted: Thu Jun 17, 2010 9:31 am    Post subject:
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

Site Director


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

PostPosted: Thu Jun 17, 2010 9:39 am    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Thu Jun 17, 2010 10:51 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm
No new posts Syncsort version supporting FINDREP c... juares castro SYNCSORT 9 Tue Aug 09, 2016 6:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us