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- IFTHEN Use

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

New User


Joined: 18 Mar 2005
Posts: 7

PostPosted: Wed Aug 11, 2010 12:45 pm    Post subject: Syncsort- IFTHEN Use
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: 2276
Location: @my desk

PostPosted: Wed Aug 11, 2010 2:09 pm    Post subject:
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: 7

PostPosted: Wed Aug 11, 2010 6:55 pm    Post subject: Reply to: Syncsort- IFTHEN Use
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: 7

PostPosted: Wed Aug 11, 2010 6:56 pm    Post subject: Reply to: Syncsort- IFTHEN Use
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: 2276
Location: @my desk

PostPosted: Wed Aug 11, 2010 7:35 pm    Post subject:
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: 7

PostPosted: Thu Aug 12, 2010 4:03 pm    Post subject: Reply to: Syncsort- IFTHEN Use
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: 2276
Location: @my desk

PostPosted: Thu Aug 12, 2010 4:42 pm    Post subject:
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    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 Need Help with : IFTHEN(WHEN=GROUP) Sumanta_89 DFSORT/ICETOOL 1 Wed Apr 19, 2017 5:23 pm
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
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


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