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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Is it possible to have a next line using INREC or OUTREC
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: 8593
Location: Back in jolly old England

PostPosted: Mon Nov 24, 2014 4:13 pm    Post subject:
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: 158
Location: Chennai

PostPosted: Mon Nov 24, 2014 4:16 pm    Post subject: Reply to: Is it possible to have a next line using INREC or
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Nov 24, 2014 4:24 pm    Post subject: Reply to: Is it possible to have a next line using INREC or
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: 1218
Location: Israel

PostPosted: Mon Nov 24, 2014 7:42 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Nov 24, 2014 7:54 pm    Post subject: Reply to: Is it possible to have a next line using INREC or
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    Post subject:
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    Post subject:
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: 1218
Location: Israel

PostPosted: Tue Nov 25, 2014 1:56 pm    Post subject: Reply to: Is it possible to have a next line using INREC or
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: 1218
Location: Israel

PostPosted: Tue Nov 25, 2014 2:25 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Nov 25, 2014 3:31 pm    Post subject: Reply to: Is it possible to have a next line using INREC or
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    Post subject: Reply to: Is it possible to have a next line using INREC or
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT- outrec ram_vizag DFSORT/ICETOOL 10 Tue Sep 27, 2016 12:50 am
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm
No new posts OUTREC FILELDS FAILS WITH ICE126A 2 ... balaji81_k DFSORT/ICETOOL 8 Sat Jul 02, 2016 1:22 am
No new posts OUTREC RDW NOT INCLUDED krsenthil85 SYNCSORT 10 Fri May 06, 2016 3:22 am
No new posts What does this INREC do? Lino Pontes DFSORT/ICETOOL 5 Fri Apr 08, 2016 12:17 am


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