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

Is it possible to have a next line using INREC or OUTREC


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
boyti ko

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Mon Nov 24, 2014 4:10 pm
Reply with quote

can it be done? or something alike?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Nov 24, 2014 4:13 pm
Reply with quote

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
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Mon Nov 24, 2014 4:16 pm
Reply with quote

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
View user's profile Send private message
boyti ko

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Mon Nov 24, 2014 4:17 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Nov 24, 2014 4:24 pm
Reply with quote

Can you paste the full sysout from your step.

Have you pasted to your post, or re-typed?
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Nov 24, 2014 7:42 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Nov 24, 2014 7:54 pm
Reply with quote

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
View user's profile Send private message
boyti ko

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Tue Nov 25, 2014 6:30 am
Reply with quote

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
View user's profile Send private message
boyti ko

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Tue Nov 25, 2014 6:32 am
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Nov 25, 2014 1:56 pm
Reply with quote

You are not very consistent with your requirements... icon_sad.gif

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Nov 25, 2014 2:25 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Nov 25, 2014 3:31 pm
Reply with quote

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
View user's profile Send private message
boyti ko

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Tue Nov 25, 2014 3:34 pm
Reply with quote

okay, thanks to all of you. i've learned so much..
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts rewrite same SAY line CLIST & REXX 8
No new posts Merge files with a key and insert a b... DFSORT/ICETOOL 6
No new posts Repeat a DD line- comment and insert ... CA Products 3
Search our Forums:

Back to Top