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
 

 

Syncsort: Conditional joining of Records

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

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Fri Nov 12, 2010 2:50 pm    Post subject: Syncsort: Conditional joining of Records
Reply with quote

Hi,
I need small assistance regarding Sort :

My requirements are as below:

Input File:
Code:

NAA0010000
NAA0020000
NAA003NEWA
NAA0010001
NAA0020000
NAA003   
NAA0010000
NAA0020000
NAA003   


Input file is a FB file with LRECL of 160 and its starting records are of three types(Length of all would be 160 ).
Type 1 :Starts with NAA001
Type 2 :Starts with NAA002
Type 3 Starts with :NAA003

Desired Output:
Code:

"Record 1 -160bytes record"|"Record Type 2" - 160 byte|"Record Type 3"
"Record 1 -160bytes record"|"Record Type 2" - 160 byte|"Record Type 3"


I Output we should have the 3 type of records together differentiated by a pipe.

There are also some conditions as below:
1.)IF all three records Rec1, rec2, rec3 are present consecutively they should be together in the output.
2.) If rec1 is present and rec 2 (or rec3) not present, we should have 160 spaces for that record at their respective place.
3.) If rec1 is not present there should be 160 spaces at the rec1 place and whatever record is present next it should be available at the particular row.

I hope this is possible using Sort.
Let me know If any other input is needed.
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Fri Nov 12, 2010 3:18 pm    Post subject:
Reply with quote

Quote:
I hope this is possible using Sort.
Are you having DFSORT in your shop? What does your SYSOUT messages say?
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Fri Nov 12, 2010 3:28 pm    Post subject:
Reply with quote

Hi Arun,
We do have DFSORT . - NOT
and What are we looking for in the SYSYOUT messages.
I wanted a sortcard for this issue.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Fri Nov 12, 2010 3:37 pm    Post subject:
Reply with quote

Quote:
What are we looking for in the SYSYOUT messages
Your sort product name and version.
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Fri Nov 12, 2010 3:53 pm    Post subject:
Reply with quote

Is this what we are looking for :

SYNCSORT FOR Z/OS 1.3.2.1R
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Fri Nov 12, 2010 4:08 pm    Post subject:
Reply with quote

Quote:
We do have DFSORT
Quote:
Is this what we are looking for :

SYNCSORT FOR Z/OS 1.3.2.1R
You said you "do have DFSORT", and now you say your SYSOUT says Syncsort!!!!!.

DFSORT and Syncsort are DIFFERENT sort products. They are not the same. I wonder why people always tend to say they have the wrong product.
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Fri Nov 12, 2010 4:48 pm    Post subject:
Reply with quote

Hi Arun,
Regret for the wrong info provided :

I have tried this code which is successfully working for joining two records :

Code:

//STEP01   EXEC  PGM=SORT                                       
//SYSOUT  DD SYSOUT=*                                           
//SORTIN   DD DSN=XXXX.AAA,DISP=SHR     
//OUT      DD DSN=XXXX.BBB,               
//             DISP=(NEW,CATLG,DELETE),                         
//             DCB=(RECFM=FB,LRECL=320,BLKSIZE=0),               
//             UNIT=PRODA,                                       
//             SPACE=(CYL,(320,100),RLSE)                       
//SYSIN DD *                                                     
  OPTION COPY                                                   
   INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(161:1,160,161:SEQ=1))
   OUTFIL FNAMES=OUT,INCLUDE=(161,1,ZD,EQ,2),                   
       BUILD=(161,160,1,160)                                     



Could you please let me know how is it to be modified for three records and with that conditions.
Thanks.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Fri Nov 12, 2010 4:59 pm    Post subject:
Reply with quote

How do you handle the below scenario.

You have Rec1 and no Rec2,Rec3 for the First Group. And you don't have Rec1, but have Rec2, Rec3 for the second group. Evenif the input is like this
Code:
Rec1
Rec2
Rec3
expected output should be
Code:
Rec1   spaces spaces
spaces Rec2   Rec3
How will you identify this though the input looks like a candidate for a combined record for all 3 types like this.
Code:
Rec1 Rec2 Rec3
Sorry if I messed up the whole thing icon_lol.gif
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Fri Nov 12, 2010 5:08 pm    Post subject:
Reply with quote

Hi Arun ,
Since the above scenerio stated by you can't be checked by data available , so it would best go as Stated by you:
Quote:

Code:
Rec1 Rec2 Rec3


And no mess and a very Valid question icon_smile.gif
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Fri Nov 12, 2010 7:52 pm    Post subject:
Reply with quote

Hi,
I have also managed to get all the three records (but without condition):

Code:

//STEP01   EXEC  PGM=ICETOOL                                       
//TOOLMSG DD SYSOUT=*                                               
//DFSMSG  DD SYSOUT=*                                               
//IN   DD DSN=XXXX.AAA,DISP=SHR     
//OUT  DD DSN=XXXX.BBB,                     
//             DISP=(NEW,CATLG,DELETE),                             
//             DCB=(RECFM=FB,LRECL=480,BLKSIZE=0),                 
//             UNIT=PRODA,                                         
//             SPACE=(CYL,(100,50),RLSE)                           
//TOOLIN DD *                                                       
 SPLICE FROM(IN) TO(OUT) ON(481,8,CH) KEEPNODUPS WITHEACH -         
  WITH(161,160) WITH(321,160) USING(CTL1)                           
/*                                                                 
//CTL1CNTL DD *                                                     
  INREC IFTHEN=(WHEN=GROUP,RECORDS=3,PUSH=(481:ID=8,SEQ=1)),       
        IFTHEN=(WHEN=(489,1,ZD,EQ,2),BUILD=(161:1,160,481:481,8)), 
        IFTHEN=(WHEN=(489,1,ZD,EQ,3),BUILD=(321:1,160,481:481,8))   
  OUTFIL FNAMES=OUT,BUILD=(1,480)                                   
/*                                                                 


Could someone assist with the conditions part ??
Thanks
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: Fri Nov 12, 2010 9:22 pm    Post subject:
Reply with quote

Hi Arun,

Quote:
DFSORT and Syncsort are DIFFERENT sort products. They are not the same. I wonder why people always tend to say they have the wrong product.
Because DFSORT has a separate / standalone part of the forum. . .
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Fri Nov 12, 2010 9:26 pm    Post subject:
Reply with quote

Thanks Dick for moving it to the right Forum.
Could you please assist me with the solution for the issue.

Thanks.
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: Fri Nov 12, 2010 9:48 pm    Post subject: Reply to: Syncsort: Conditional joining of Records
Reply with quote

You're welcome icon_smile.gif

If this was a requirement for my group, it would be done with code not sort. . . I suspect there is more to the requirement than only re-arranging the data.

I slso suspect that there is a desire to create these consolodated records so that the original file will not need to be used by some programmer(s) (either due to lack of skill or just wanting to avoid the work).

Most of what i'm involved with is hundreds of millions of records of length from 4k to 30k bytes and extra passes and copies are not encouraged. . .

d
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Sat Nov 13, 2010 12:49 am    Post subject:
Reply with quote

Hi Dick,

But I would really need a solution to this Either your way or the Sort way.
May be Frank from could lend some suggestion.

And about the requirements they are currently only for rearranging the data.
Thanks.
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: Sat Nov 13, 2010 1:16 am    Post subject:
Reply with quote

Hello,

You have Syncsort.

Frank is a DFSORT developer and usually does not answer Syncsort questions as they are competing products.

Quote:
Either your way
Write code to read the records, store them until the "next key" is encountered, and then write what is needed to the output file.
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Mon Nov 15, 2010 7:54 pm    Post subject:
Reply with quote

Thanks a lot Dick for your suggestion icon_smile.gif.
But I still hope , somebody from Synchsort could really advise on this.
and I need this urgently now.
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: Mon Nov 15, 2010 8:04 pm    Post subject:
Reply with quote

Saurabh Pune wrote:
But I still hope , somebody from Synchsort could really advise on this.
and I need this urgently now.
Oh well, that's life.

This is actually a HELP FORUM, and although you appear to have tried something yourself, while sitting around waiting for the person you deem as the "right" person to advise, I would have taken up the suggestion of Dick and worked on an alternative solution.

As for any urgency, tough luck, that is solely YOUR problem and expecting to get a timeous solution from a volunteer forum is not the way to proceed.
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Mon Nov 15, 2010 8:17 pm    Post subject:
Reply with quote

thanks Expat for the inspiring words.

Quote:

As for any urgency, tough luck, that is solely YOUR problem and expecting to get a timeous solution from a volunteer forum is not the way to proceed.


I am still working different things with the Sort itself bcoz I have worked on it frm last 5 days, and just don't want and feel to start afresh with the COBOL thing, although the Advice still stands good.

Just looking for some Timely help from a HELP FORUM icon_smile.gif

Hope is what keeps everybody alive icon_smile.gif
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: Mon Nov 15, 2010 8:36 pm    Post subject:
Reply with quote

Hello,

Quote:
Thanks a lot Dick for your suggestion
You're welcome icon_smile.gif

Quote:
Hope is what keeps everybody alive
Hope along with the willingness to change direction when the situation calls for it.

In the future, suggest you place a (short) restriction on how long you will wait for someone to provide the "sort code". If, when you read my reply (i replied on the 12th), you had implemented the code, it would have been done on Saturday. . . It should be a very small amount of code.

Also, it is usually not a good idea to post urgent problems on a help forum. Others do not have/share your sense of urgency. Something else to consider is to open a support issue directly with Syncsort.
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 1 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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