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 SUM FIELDS= Second field is off by one byte. ??

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort SUM FIELDS= Second field is off by one byte. ??
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

Site Director


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

PostPosted: Sat Jul 24, 2010 1:00 am    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Sat Jul 24, 2010 1:03 am    Post subject:
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    Post subject: Reply to: Syncsort SUM FIELDS= Second field is off by one
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Sat Jul 24, 2010 2:07 am    Post subject:
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

Site Director


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

PostPosted: Sat Jul 24, 2010 2:07 am    Post subject: Reply to: Syncsort SUM FIELDS= Second field is off by one
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    Post subject:
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

Site Director


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

PostPosted: Sat Jul 24, 2010 2:43 am    Post subject:
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    Post subject: Reply to: Syncsort SUM FIELDS= Second field is off by one
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: 2164
Location: @my desk

PostPosted: Tue Jul 27, 2010 3:47 pm    Post subject:
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    Post subject: Reply to: Syncsort SUM FIELDS= Second field is off by one
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: 2164
Location: @my desk

PostPosted: Wed Jul 28, 2010 6:14 pm    Post subject:
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    Post subject: Reply to: Syncsort SUM FIELDS= Second field is off by one
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: 2164
Location: @my desk

PostPosted: Thu Jul 29, 2010 2:23 pm    Post subject:
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    Post subject: Reply to: Syncsort SUM FIELDS= Second field is off by one
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: 2164
Location: @my desk

PostPosted: Thu Jul 29, 2010 7:04 pm    Post subject:
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    Post subject:
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: 2164
Location: @my desk

PostPosted: Mon Aug 02, 2010 5:04 pm    Post subject:
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    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 Performing arithmetic on input field zh_lad DFSORT/ICETOOL 22 Tue Dec 06, 2016 8:04 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 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


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