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 Help

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

New User


Joined: 31 Aug 2008
Posts: 31
Location: hyderabad

PostPosted: Fri Jun 03, 2011 11:24 am    Post subject: SYNCSORT Help
Reply with quote

I have 2 PS files.
And I need to create 3rd file with entries which are present in file 1 but not in file 2, using syncsort.

File 1 structure is as below,

Code:

12345678901234567890 <== just the scale
ABCD           1234
               5678
               9233
EFGH           1111
               3333
ABCD           6767



File 2 structure is as below,
Code:

12345678901234567890 <== just the scale
ABCD           1234
ABCD           5678
ABCD           9233
EFGH           1111
EFGH           3333


Is there any way to Sort the first file and create a loop for file 1 to match with file 2?

Expected output is F3:
Code:

12345678901234567890 <== just the scale
ABCD           6767


Both are PS files,
File1 LRECL = 32
File2 LRECL = 80
File3 LRECL = 80

Please let me know if you need any more details.

Thanks in advance.
Back to top
View user's profile Send private message

chatterjesis

New User


Joined: 31 Aug 2008
Posts: 31
Location: hyderabad

PostPosted: Fri Jun 03, 2011 11:27 am    Post subject:
Reply with quote

The structure got distorted in the above post icon_sad.gif
FIXED

Column 1 starts at position 1 and column 2 starts are position 16 for both F1 and F2.

I am really sorry for the formatting error.
Back to top
View user's profile Send private message
rmaruri

New User


Joined: 29 Jun 2005
Posts: 13
Location: USA

PostPosted: Mon Jun 06, 2011 7:07 am    Post subject: Reply to: SYNCSORT Help
Reply with quote

Use SORT JOIN.

Here is the sample. Change it as per the requirement.

JOINKEYS FILES=F1,FIELDS=(1,6,A)
JOINKEYS FILES=F2,FIELDS=(1,6,A)
JOIN UNPAIRED F1,ONLY
REFORMAT FIELDS=(F1:1,6)
SORT FIELDS=COPY
Back to top
View user's profile Send private message
chatterjesis

New User


Joined: 31 Aug 2008
Posts: 31
Location: hyderabad

PostPosted: Mon Jun 06, 2011 5:33 pm    Post subject: Reply to: SYNCSORT Help
Reply with quote

I was using the same code as suggested but this one gives, along with ABC 6767

5678
9233
3333

comes in the output, but i need only the below entry
ABCD 6767
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Mon Jun 06, 2011 5:59 pm    Post subject: Reply to: SYNCSORT Help
Reply with quote

I suppose if you don't want the blank keys at all, just OMIT them.

If the blank keys are supposed to inherit the key value of the previous non-blank key, then you'll need to do a bit of tinkering.
Back to top
View user's profile Send private message
chatterjesis

New User


Joined: 31 Aug 2008
Posts: 31
Location: hyderabad

PostPosted: Mon Jun 06, 2011 8:36 pm    Post subject: Reply to: SYNCSORT Help
Reply with quote

Thanks Bill for the reply...
Yes, you got it correct, the blank fields should retain the previous non blank values. Is there any looping facility? or something to keep it stored?

Thanks in advance.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Tue Jun 07, 2011 12:10 am    Post subject: Reply to: SYNCSORT Help
Reply with quote

I don't think there is any "looping" available. I think you can define groups of records such that they can be processed with the key from the first record in the group.

I'd look at the manual Table of Contents and Index. Search this forum. Search the internet. Hope that someone with more specific knowledge than I have picks this up again :-)

Unfortunately, SYNCSORT manuals are not generally available unless you are entitled to one, which I'm not.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Tue Jun 07, 2011 2:22 am    Post subject:
Reply with quote

chatterjesis,

Tried on DFSort but should work on Syncsort. AFAIK, Syncsort doesn't allow "subtasking".
Also,why do you need output with 80 bytes? If you are just selecting unmatched records from file1, shouldn't your output be 32 bytes only?
Code:

//STEP0001     EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD DISP=SHR,DSN=YOUR INPUT1 FB32                       
//SORTOUT  DD DISP=(NEW,PASS),DSN=&&T1                           
//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                               
  OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,GT,C' '),PUSH=(1:1,4)) 
/*                                                               
//STEP0002     EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                           
//SORTJNF1 DD DISP=SHR,DSN=&&T1                                   
//SORTJNF2 DD DISP=SHR,DSN=YOUR INPUT2 FB80                       
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                   
  JOINKEYS FILES=F1,FIELDS=(01,04,A,16,04,A)                     
  JOINKEYS FILES=F2,FIELDS=(01,04,A,16,04,A)                     
  JOIN UNPAIRED,F1,ONLY                                           
  REFORMAT FIELDS=(F1:01,32)                                     
  INREC OVERLAY=(80:X)                                           
  SORT FIELDS=COPY                                                                                                                                   


OUTPUT
Code:

ABCD           6767


Thanks,
Back to top
View user's profile Send private message
chatterjesis

New User


Joined: 31 Aug 2008
Posts: 31
Location: hyderabad

PostPosted: Wed Jun 08, 2011 9:41 am    Post subject: Reply to: SYNCSORT Help
Reply with quote

Thanks a lot!
This one worked like wonder!
Back to top
View user's profile Send private message
prasanth_thavva

New User


Joined: 28 Jul 2005
Posts: 86
Location: Chennai

PostPosted: Sat Jun 18, 2011 7:52 am    Post subject: Reply to: SYNCSORT Help
Reply with quote

Even we can use OMIT COND to eliminate the records which has spaces in first 4 bytes and then in the next step we can use join keys to un matched records from file A i think achieve the results
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Sat Jun 18, 2011 8:13 am    Post subject:
Reply with quote

Prasanth
chatterjesis wrote:
Thanks Bill for the reply...
Yes, you got it correct, the blank fields should retain the previous non blank values. Is there any looping facility? or something to keep it stored?

Thanks in advance.

Thanks,
Back to top
View user's profile Send private message
prasanth_thavva

New User


Joined: 28 Jul 2005
Posts: 86
Location: Chennai

PostPosted: Sat Jun 18, 2011 12:11 pm    Post subject: Reply to: SYNCSORT Help
Reply with quote

Sql'

Thanks, but actually i would like to figure out what exactly below card does when it executes

OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,GT,C' '),PUSH=(1:1,4))

I have got it like if the first 4 bytes are spaces push, but exactly what push command does ? can you explain me

whether it will write this in temporary area if it a has spaces in first 4 bytes
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 Jun 18, 2011 11:08 pm    Post subject:
Reply with quote

Hello,

Quote:
I have got it like if the first 4 bytes are spaces push,
Try working with the code - i believe this is incorrect.

Suggest you look at other topics that have done GROUPing. . .
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