|
View previous topic :: View next topic
|
| Author |
Message |
mdfogg
New User
Joined: 18 Jan 2006 Posts: 9 Location: Currently Indianapolis
|
|
|
|
| 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 |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
Which is the "second field"? What is the input? |
|
| Back to top |
|
 |
CICS Guy
Senior Member

Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
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 |
|
 |
mdfogg
New User
Joined: 18 Jan 2006 Posts: 9 Location: Currently Indianapolis
|
|
|
|
well I thought I was off by one too, but I checked that.
It is -3 because... -1 + -1 + -1 = -3
All the sysouts? |
|
| Back to top |
|
 |
mdfogg
New User
Joined: 18 Jan 2006 Posts: 9 Location: Currently Indianapolis
|
|
|
|
Never mind . I guess I really am off...  |
|
| Back to top |
|
 |
CICS Guy
Senior Member

Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
| mdfogg wrote: |
well I thought I was off 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...
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 |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thanks for letting us know
Have a great weekend - always better when walking out with a Victory . . .
d |
|
| Back to top |
|
 |
mdfogg
New User
Joined: 18 Jan 2006 Posts: 9 Location: Currently Indianapolis
|
|
|
|
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 |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Why code for the 'G' at all if there is no action to be taken? |
|
| Back to top |
|
 |
mdfogg
New User
Joined: 18 Jan 2006 Posts: 9 Location: Currently Indianapolis
|
|
|
|
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 |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
| What about the length and format of fields A,X,Y, Z and the fields which you do SUM on? |
|
| Back to top |
|
 |
mdfogg
New User
Joined: 18 Jan 2006 Posts: 9 Location: Currently Indianapolis
|
|
|
|
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 |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
mdfogg,
What are the starting positions of the abovesaid fields? |
|
| Back to top |
|
 |
mdfogg
New User
Joined: 18 Jan 2006 Posts: 9 Location: Currently Indianapolis
|
|
|
|
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 |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
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 |
|
 |
mdfogg
New User
Joined: 18 Jan 2006 Posts: 9 Location: Currently Indianapolis
|
|
|
|
Thanks, you are right on the field size.
I'm impressed. It works!! Of course you knew it would
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 |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
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'.
| 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 |
|
 |
mdfogg
New User
Joined: 18 Jan 2006 Posts: 9 Location: Currently Indianapolis
|
|
|
|
That did it!
Thank you VERY much!
I'm passing your quote to my 15 yr old daughter too.
Mark |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
Glad that I could be of some help.  |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|