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

Syncsort SUM FIELDS= Second field is off by one byte. ??


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

New User


Joined: 18 Jan 2006
Posts: 9
Location: Currently Indianapolis

PostPosted: Sat Jul 24, 2010 12:26 am
Reply with quote

Code:
INREC IFTHEN=(WHEN=(01,1,CH,NE,C'G'),       
              OVERLAY=(02:2C' '),HIT=NEXT),
      IFTHEN=(WHEN=(01,1,CH,NE,C'V'),       
              OVERLAY=(04:7C' ')),         
      IFTHEN=(WHEN=(11,1,CH,EQ,C'W'),       
              OVERLAY=(10:C'O'))           
                       
SORT FIELDS=(1,1,CH,A,                     
            15,4,CH,A,                     
            02,2,CH,A,                     
            04,6,CH,A,                     
            10,1,CH,A,                     
            11,1,CH,A,                     
            14,1,CH,A,                     
            12,2,CH,A)                     
SUM FIELDS=(19,4,ZD,                       
                    23,5,ZD) 


Sorry the spacing doesn't match.
(it does now, code'd)
Code:
 ----+----1----+----2----+--
 GF8       OI150612000{0003}
 CCF4444444DCFFFFFFFFFCFFFFD
 768000000069150612000000030
  --------------------------
 Should be                            **

 GF8       OI150612000{0000L
 CCF4444444DCFFFFFFFFFCFFFFD
 768000000069150612000000003
  --------------------------

Thanks!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sat Jul 24, 2010 1:00 am
Reply with quote

Hello and welcome to the forum,

Which is the "second field"? What is the input?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sat Jul 24, 2010 1:03 am
Reply with quote

The 'GF8' record is output?
Why should it not be a -30 instead of a -3?
Please post all the sysouts and the ''GF8' input records.
Back to top
View user's profile Send private message
mdfogg

New User


Joined: 18 Jan 2006
Posts: 9
Location: Currently Indianapolis

PostPosted: Sat Jul 24, 2010 1:32 am
Reply with quote

well I thought I was off icon_lol.gif by one too, but I checked that.
It is -3 because... -1 + -1 + -1 = -3

All the sysouts?
Back to top
View user's profile Send private message
mdfogg

New User


Joined: 18 Jan 2006
Posts: 9
Location: Currently Indianapolis

PostPosted: Sat Jul 24, 2010 2:01 am
Reply with quote

Never mind . I guess I really am off... icon_redface.gif
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sat Jul 24, 2010 2:07 am
Reply with quote

mdfogg wrote:
well I thought I was off icon_lol.gif by one too, but I checked that.
It is -3 because... -1 + -1 + -1 = -3
If there is only three 'GF8' records withe a -1 in each, you do have a problem. Try adding an INCLUDE COND=(1,3,CH,EQ,C'GF8') for a good count...
Quote:
All the sysouts?

Yes, cut&paste the at least the sysout from Syncsort, that should list what the sort is processing and how it sees your request.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sat Jul 24, 2010 2:07 am
Reply with quote

Good to hear it is working - thanks for letting us know icon_smile.gif

Have a great weekend - always better when walking out with a Victory . . .

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

New User


Joined: 18 Jan 2006
Posts: 9
Location: Currently Indianapolis

PostPosted: Sat Jul 24, 2010 2:34 am
Reply with quote

BTW
Is there a way... ??
If a field is EQ 'g' do not overlay otherfield

kind of an if than else
if field EQ 'g' continue
else move 'x' to otherfield.

I could use NE 'g' but 'v' does something else and 'q' does something entirely different etc.

Thanks!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sat Jul 24, 2010 2:43 am
Reply with quote

Hello,

Why code for the 'G' at all if there is no action to be taken?
Back to top
View user's profile Send private message
mdfogg

New User


Joined: 18 Jan 2006
Posts: 9
Location: Currently Indianapolis

PostPosted: Mon Jul 26, 2010 6:48 pm
Reply with quote

The original code is
if field A = 'g'
then field X = field B
else
field X = spaces.

if field A = 'v'
then field Y = field C
field Z = filed D
else
field Y & Z = spaces.

sort by field A X Y Z


Thanks for your help.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Jul 27, 2010 3:47 pm
Reply with quote

What about the length and format of fields A,X,Y, Z and the fields which you do SUM on?
Back to top
View user's profile Send private message
mdfogg

New User


Joined: 18 Jan 2006
Posts: 9
Location: Currently Indianapolis

PostPosted: Tue Jul 27, 2010 9:10 pm
Reply with quote

Field A 1 byte
Field B & X 2 bytes
Field C & Y 6 bytes
Field D & Z 2 bytes

SUM FIELDS=(19,4,ZD,
23,5,ZD)
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Jul 28, 2010 6:14 pm
Reply with quote

mdfogg,

What are the starting positions of the abovesaid fields?
Back to top
View user's profile Send private message
mdfogg

New User


Joined: 18 Jan 2006
Posts: 9
Location: Currently Indianapolis

PostPosted: Wed Jul 28, 2010 6:59 pm
Reply with quote

Field A 1 byte pos 1
Field B pos 2,2
X pos 28, 2
Field C pos 4, 6
Y 6 bytes pos 30, 6
Field D & pos 11,1
Z 2 bytes pos 36, 2
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Jul 29, 2010 2:23 pm
Reply with quote

mdfogg,

Quote:
Field D & pos 11,1
I have assumed this as 11,2 as your earlier post said
Quote:
Field D & Z 2 bytes
Also your initial SORT FIELDS statement had so many fields, but as your latest post, you need to SORT only on the fields A X Y Z. You might try the below Syncsort job for your requirement
Code:
INREC IFTHEN=(WHEN=INIT,
              OVERLAY=(28:2,2,30:4,6,36:11,2)),
      IFTHEN=(WHEN=(1,1,CH,NE,C'G'),
              OVERLAY=(28:2X),HIT=NEXT),
      IFTHEN=(WHEN=(1,1,CH,NE,C'V'),
              OVERLAY=(30:8X))
SORT FIELDS=(1,1,CH,A,28,10,CH,A)
SUM FIELDS=(19,4,ZD,23,5,ZD)
Back to top
View user's profile Send private message
mdfogg

New User


Joined: 18 Jan 2006
Posts: 9
Location: Currently Indianapolis

PostPosted: Thu Jul 29, 2010 6:48 pm
Reply with quote

Thanks, you are right on the field size.

I'm impressed. It works!! Of course you knew it would icon_smile.gif

I just didn't understand the logic behind the WHEN=INIT,

If I restate that... the "WHEN=INIT" affects every value that is not mentioned in the following "IFTHEN=(WHEN="s

I need to add one wrinkle to the equation...
What/where do i add this. I've tried multiple scenarios, but I have not hit on the right combination.

IFTHEN=(WHEN=(11,1,CH,EQ,C'W'),
OVERLAY=(10:C'O'))

Thank you for your help!

Mark
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Jul 29, 2010 7:04 pm
Reply with quote

Mark,

From your latest post, it seems like it would be enough to add it here. I don't know if you have already tried this 'combination'. icon_smile.gif
Code:
INREC IFTHEN=(WHEN=INIT,
              OVERLAY=(28:2,2,30:4,6,36:11,2)),
      IFTHEN=(WHEN=(1,1,CH,NE,C'G'),
              OVERLAY=(28:2X),HIT=NEXT),
      IFTHEN=(WHEN=(1,1,CH,NE,C'V'),
              OVERLAY=(30:8X),HIT=NEXT),
      IFTHEN=(WHEN=(11,1,CH,EQ,C'W'),
              OVERLAY=(10:C'O'))
SORT FIELDS=(1,1,CH,A,28,10,CH,A)
SUM FIELDS=(19,4,ZD,23,5,ZD)


The WHEN=INIT is used to provide initial values to fields. So I have rearranged all the fields in the 'WHEN=INIT' itself and then later on checked for each 'NE' condition in the subsequent IFTHENs and replaced the fields with SPACES wherever required.
Back to top
View user's profile Send private message
mdfogg

New User


Joined: 18 Jan 2006
Posts: 9
Location: Currently Indianapolis

PostPosted: Thu Jul 29, 2010 7:34 pm
Reply with quote

That did it!
Thank you VERY much!

I'm passing your quote to my 15 yr old daughter too. icon_smile.gif

Mark
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Mon Aug 02, 2010 5:04 pm
Reply with quote

Glad that I could be of some help. 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 Help required to reset decimal points... DFSORT/ICETOOL 5
No new posts Syncsort help SYNCSORT 3
No new posts SYNCSORT-DB2 interface SYNCSORT 0
No new posts Sorting Date Field DFSORT/ICETOOL 4
No new posts Pull data using date difference betwe... DB2 6
Search our Forums:

Back to Top