View previous topic :: View next topic
Author
Message
boyti ko New User Joined: 03 Nov 2014Posts: 78 Location: Malaysia
can it be done? or something alike?
Back to top
expat Global Moderator Joined: 14 Mar 2007Posts: 8797 Location: Welsh Wales
Perhaps if you made an effort to actually explain EXACTLY what you are asking it may make it easier to get some help.
Back to top
magesh23586 Active User Joined: 06 Jul 2009Posts: 213 Location: Chennai
Yes, You can use '/' to have next line.
example
Code:
OUTFIL OUTREC=(2/,C’Field 2 contains ’,4,3,/,
C’Field 1 contains ’,1,3)
Regards,
Magesh
Back to top
boyti ko New User Joined: 03 Nov 2014Posts: 78 Location: Malaysia
im doing something like this, but i don't know what's the problem..
i was thinking that this would answer my question, but i can't seem to make it work.
is there anything wrong with my HIT=NEXT
Code:
OUTFIL IFTHEN=(WHEN=(1,14,CH,EQ,C'TEST'),
BUILD=(1,80,/,
C'OUTPUT1',80:X),HIT=NEXT),
IFTHEN=(WHEN=(1,14,CH,EQ,C' C'TEST'),
BUILD=(1,80,/,
C'OUTPUT2',80:X))
output should be something like this..
Code:
----+----1----+----2----+----3----+
TEST
OUTPUT1
TEST
OUTPUT2
Back to top
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
Can you paste the full sysout from your step.
Have you pasted to your post, or re-typed?
Back to top
Marso REXX Moderator Joined: 13 Mar 2006Posts: 1353 Location: Israel
boyti ko wrote:
Code:
OUTFIL IFTHEN=(WHEN=(1,14,CH,EQ,C'TEST'),
BUILD=(1,80,/,
C'OUTPUT1',80:X),HIT=NEXT),
IFTHEN=(WHEN=(1,14,CH,EQ,C' C'TEST'),
BUILD=(1,80,/,
C'OUTPUT2',80:X))
(1,14,CH,EQ,C'TEST') means the word TEST is on the left, with 10 spaces on the right.
(1,14,CH,EQ,C' C'TEST') is just invalid...
You could use WHEN=NONE in the last IFTHEN.
In your examples, 1,14,CH is all spaces, which does not answer to any of your conditions and all records are discarded.
Back to top
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
boyti ko,
As well as pasting the sysout, can you explain what it is you are trying to do, what is the requirement you are attempting to serve?
Back to top
boyti ko New User Joined: 03 Nov 2014Posts: 78 Location: Malaysia
if i do it like this,
Code:
//STEP020 EXEC PGM=SORT
//SORTIN DD *
TEST1
TEST2
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL IFTHEN=(WHEN=(1,5,CH,EQ,C'TEST1'),
BUILD=(1,80,/,C'OUTPUT1')),
IFTHEN=(WHEN=(1,5,CH,EQ,C'TEST2'),
BUILD=(1,80,/,C'OUTPUT2'))
//SORTOUT DD SYSOUT=*
my output is like this
Code:
----+----1
**********
TEST1
OUTPUT1
TEST2
OUTPUT2
but i want my output to be like this,
Code:
----+----1
**********
TEST1
OUTPUT1
TEST1
OUTPUT2
TEST2
so what i did is like this,
Code:
//STEP020 EXEC PGM=SORT
//SORTIN DD *
TEST1
TEST2
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL IFTHEN=(WHEN=(1,5,CH,EQ,C'TEST1'),
BUILD=(1,80,/,C'OUTPUT1'),HIT=NEXT),
IFTHEN=(WHEN=(1,5,CH,EQ,C'TEST1'),
BUILD=(1,80,/,C'OUTPUT2'))
//SORTOUT DD SYSOUT=*
it seems the HIT=NEXT won't work if im using BUILD..
Back to top
boyti ko New User Joined: 03 Nov 2014Posts: 78 Location: Malaysia
here's my sysout:
Code:
1ICE805I 1 JOBNAME: XXXXXXXX , STEPNAME: STEP020
ICE802I 0 BLOCKSET TECHNIQUE IN CONTROL
ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 09:01 ON TUE NOV 25, 2014 -
0 SORT FIELDS=COPY
OUTFIL IFTHEN=(WHEN=(1,5,CH,EQ,C'TEST1'),
BUILD=(1,80,/,C'OUTPUT1'),HIT=NEXT),
$
ICE214A 6 DUPLICATE, CONFLICTING, OR MISSING OUTFIL STATEMENT OPERANDS
IFTHEN=(WHEN=(1,5,CH,EQ,C'TEST1'),
$
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
BUILD=(1,80,/,C'OUTPUT2'))
$
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
ICE751I 0 C5-I12416 C6-K90026 C7-K94453 C8-K94453 E7-I12416
ICE052I 3 END OF DFSORT
Back to top
Marso REXX Moderator Joined: 13 Mar 2006Posts: 1353 Location: Israel
You are not very consistent with your requirements...
But if that's what you want, you can plainly use:
Code:
SORT FIELDS=COPY
OUTFIL IFTHEN=(WHEN=(1,5,CH,EQ,C'TEST1'),
BUILD=(1,80,/,C'OUTPUT1',/,1,80,/,C'OUTPUT2'))
Back to top
Marso REXX Moderator Joined: 13 Mar 2006Posts: 1353 Location: Israel
boyti ko wrote:
Code:
OUTFIL IFTHEN=(WHEN=(1,5,CH,EQ,C'TEST1'),
BUILD=(1,80,/,C'OUTPUT1'),HIT=NEXT),
$
ICE214A 6 DUPLICATE, CONFLICTING, OR MISSING OUTFIL STATEMENT OPERANDS
When I tried (using SYNCSORT), I got a similar error. It worked when I removed the '/' from the BUILD parameter.
I searched the documentation (both DFSORT and SYNCSORT) but found nothing about this restriction.
Actually I tried twice, different format gave me different indications, and that put me on the tracks:
Code:
OUTFIL IFTHEN=(WHEN=(1,5,CH,EQ,C'TEST1'),
BUILD=(1,80,/,C'OUTPUT1'),HIT=NEXT),
*
IFTHEN=(WHEN=(1,5,CH,EQ,C'TEST1'),
BUILD=(1,80,/,C'OUTPUT2'))
WER268A OUTFIL STATEMENT : SYNTAX ERROR
Code:
OUTFIL IFTHEN=(WHEN=(1,5,CH,EQ,C'TEST1'),HIT=NEXT,
BUILD=(1,73,C'OUTPUT1',/,1,80)),
*
IFTHEN=(WHEN=ANY,
BUILD=(1,80,/,C'OUTPUT2'))
WER268A OUTFIL STATEMENT : SYNTAX ERROR
Back to top
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
You use HIT=NEXT when you want to identify more than one condition which exists on the same record for different processing.
It would be nuts to generate multiple records from a record which has already had multiple records generated for it (what would it do, sensibly?).
BUILD works fine with HIT=NEXT. The slash operator (/) works fine with BUILD. It is illogical to expect the slash operator to work with HIT=NEXT.
I can't see that you need the HIT=NEXT here anyway. You are testing the same data position for a different value, so HIT=NEXT is superfluous in this case anyway.
One use of BUILD slash operator per record.
Back to top
boyti ko New User Joined: 03 Nov 2014Posts: 78 Location: Malaysia
okay, thanks to all of you. i've learned so much..
Back to top
Please enable JavaScript!