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

Syncsort- IFTHEN Use


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

New User


Joined: 18 Mar 2005
Posts: 9

PostPosted: Wed Aug 11, 2010 12:45 pm
Reply with quote

Hi,

I am trying to do a match using SYNCSORT and only in case if 22,2,ch,eq,c'9A' we need to overlay with records from other portion.
Also we need both matched and unmatced records in seperate file.

JOINKEYS FILES=F1,FIELDS=(1,17,A)
JOINKEYS FILES=F2,FIELDS=(1,17,A),INCLUDE=(22,2,CH,EQ,C'1A')
REFORMAT FIELDS=(F1:1,255,F2:1,255),FILL=X'FF'
JOIN UNPAIRED
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(1,1,BI,NE,X'FF',AND,256,1,BI,NE,X'FF'),
OUTREC IFTHEN=(WHEN=(22,2,CH,EQ,C'9A'),
BUILD=(1,43,44:364,10,54:305,8,62,193)),
IFTHEN=(WHEN=NONE,
BUILD=(1,255))
OUTFIL FILES=02,INCLUDE=(256,1,BI,EQ,X'FF'),OUTREC=(1,255)


I am using SYNCSORT FOR Z/OS 1.3.2.0R.
I believe from the error message I am getting, that IFTHEN is not supported by this version of SYNCSORT.

Any help to achieve the above logic would be helpful.


Thanks,
Dipsy
_______________
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Aug 11, 2010 2:09 pm
Reply with quote

Dipsy,

You have messed up with the syntax here. IFTHEN is supported even by older verisons of Syncsort and you have the latest version!

Can you explain what are you trying to do here, especially in the case of a match. Also I just noticed your field lengths in the case of a match add only upto 254 and not 255.
Back to top
View user's profile Send private message
dipsybaby

New User


Joined: 18 Mar 2005
Posts: 9

PostPosted: Wed Aug 11, 2010 6:55 pm
Reply with quote

Hi,

We are doing a match on 2 files based on the key fields from 1,17. File 2 records only where 22,2,ch,eq,C'1A' should be consnidered.
And also I need unmatched records only from file1 in SORTOF02.

The approach to this is
In case of Matche records,
1. they should be moved to SORTOF01 and
2. when 22,2,ch,eq,C'9A' we need to copy data from file 2 matched record and replace columns 44,10 with 109,10 and 54,8 with 50,8 from file 2 records.

Please let me know any solution you cn think of.

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

New User


Joined: 18 Mar 2005
Posts: 9

PostPosted: Wed Aug 11, 2010 6:56 pm
Reply with quote

Also both my files reord length is 255
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Aug 11, 2010 7:35 pm
Reply with quote

But you're building only 254 positions, Am I missing something?
BUILD=(1,43,44:364,10,54:305,8,62,193)

Assuming the 255th pos as blank, here's an UNTESTED one.
Code:
JOINKEYS FILES=F1,FIELDS=(1,17,A)
JOINKEYS FILES=F2,FIELDS=(1,17,A),INCLUDE=(22,2,CH,EQ,C'1A')
REFORMAT FIELDS=(F1:1,255,F2:1,255)
JOIN UNPAIRED,F1
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(256,1,CH,NE,C' '),
       IFTHEN=(WHEN=(22,2,CH,EQ,C'9A'),
       BUILD=(1,43,364,10,305,8,62,193,X)),
       IFTHEN=(WHEN=NONE,BUILD=(1,255))
OUTFIL FILES=02,SAVE,BUILD=(1,255)
Back to top
View user's profile Send private message
dipsybaby

New User


Joined: 18 Mar 2005
Posts: 9

PostPosted: Thu Aug 12, 2010 4:03 pm
Reply with quote

Hi arun,.

Thank you very much. It is working perfectly. I had missed one of the bytes while building the record. Thanks for pointing it out icon_smile.gif

Thankd,
Dipsy
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Aug 12, 2010 4:42 pm
Reply with quote

Dipsy,

You're welcome. Glad that it worked well icon_smile.gif
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 Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Syncsort "Y2C" Function SYNCSORT 1
Search our Forums:

Back to Top