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

Just a question about conditions and outrec


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gabriel.ryoga

New User


Joined: 07 Jun 2007
Posts: 31
Location: Spain

PostPosted: Tue May 27, 2008 5:59 pm
Reply with quote

I've this sysin:
Code:

SORT FIELDS=COPY                   
   OUTFIL FNAMES=FILE1,           
    INCLUDE=(84,15,ZD,GE,208,15,ZD)
    OUTREC FIELDS=(C'T',1,239)     
   OUTFIL FNAMES=FILE2,         
    INCLUDE=(84,15,ZD,LT,208,15,ZD)
    OUTREC FIELDS=(C'T',1,239)


I was trying to create two files, one with the regs with number in position 84, greater or equal than the number in position 208.
And other file with number in pos 84 less than number in pos 208.

That didn't worked, and everytime I was getting all regs in file 2....

So I changed to this one:
Code:

 SORT FIELDS=COPY                   
 INREC FIELDS(C'T',1,239)           
    OUTFIL FNAMES=FILE1,           
     INCLUDE=(85,15,ZD,GE,209,15,ZD)
    OUTFIL FNAMES=FILE2,         
     INCLUDE=(85,15,ZD,LT,209,15,ZD)


This Sysin worked fine for my needs, but I still don't understand why the first one didn't worked....

can somebody explain it??
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Tue May 27, 2008 6:06 pm
Reply with quote

Can you post samples of the data in the input file please?
Back to top
View user's profile Send private message
gabriel.ryoga

New User


Joined: 07 Jun 2007
Posts: 31
Location: Spain

PostPosted: Tue May 27, 2008 6:23 pm
Reply with quote

INPUT1:
Code:

00000000000001C00000000000002C
00000000000003C00000000000001C


FILE1:
Code:

T00000000000003C00000000000001C


FILE2:
Code:

T00000000000001C00000000000002C


SYSIN1:
Code:

SORT FIELDS=COPY                   
   OUTFIL FNAMES=FILE1,           
    INCLUDE=(1,15,ZD,GE,16,15,ZD)
    OUTREC FIELDS=(C'T',1,30)     
   OUTFIL FNAMES=FILE2,         
    INCLUDE=(1,15,ZD,LT,16,15,ZD)
    OUTREC FIELDS=(C'T',1,30)


SYSIN2:
Code:

 SORT FIELDS=COPY                   
 INREC FIELDS(C'T',1,30)           
    OUTFIL FNAMES=FILE1,           
     INCLUDE=(1,15,ZD,GE,16,15,ZD)
    OUTFIL FNAMES=FILE2,         
     INCLUDE=(1,15,ZD,LT,16,15,ZD)



I would like to know why is working SYSIN2 and not SYSIN1.

Thanks.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue May 27, 2008 6:43 pm
Reply with quote

gabriel.ryoga wrote:
I would like to know why is working SYSIN2 and not SYSIN1.
Are you syre that you don't have SYSIN1 and SYSIN2 reversed?

What I see is
SYSIN1:
Code:
00000000000001C GE 00000000000002C FALSE
00000000000003C GE 00000000000001C TRUE
123456789012345    123456789012345

SYSIN2:
Code:
T00000000000001 GE C00000000000002 TRUE
T00000000000003 GE C00000000000001 TRUE
123456789012345    123456789012345
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Tue May 27, 2008 6:46 pm
Reply with quote

I was misled by the 208,15 and 209,15 in your first post and was thinking on the lines why the first one (208,15) didn't work and the second one (209,15) worked.

Only now i realised that you were referring to the OUTREC FIELDS. It didn't work in mine too and the error message was duplicate outrec statements. This may have something to do with the version of DFSORT but i will let the experts to comment on that.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue May 27, 2008 9:06 pm
Reply with quote

Gabriel,

Code:

  SORT FIELDS=COPY
  OUTFIL FNAMES=FILE1,                 <--- first OUTFIL statement
    INCLUDE=(84,15,ZD,GE,208,15,ZD)    <--- first OUTFIL statement
  OUTREC FIELDS=(C'T',1,239)           <--- first OUTREC statement
  OUTFIL FNAMES=FILE2,                 <--- second OUTFIL statement
    INCLUDE=(84,15,ZD,LT,208,15,ZD)    <--- second OUTFIL statement
  OUTREC FIELDS=(C'T',1,239)           <--- dup OUTREC statement


The problem with the statements above is that you are using the wrong syntax for what you want to do. You are mixing up the OUTREC statement with the OUTREC operand of the OUTFIL statement. This is the reason we recommend that you use the BUILD operand rather than the OUTREC operand. The correct syntax for what you want to do would be:

Code:

  SORT FIELDS=COPY
  OUTFIL FNAMES=FILE1,                 <--- first OUTFIL statement
    INCLUDE=(84,15,ZD,GE,208,15,ZD),   <--- first OUTFIL statement
    BUILD=(C'T',1,239)                 <--- first OUTFIL statement
  OUTFIL FNAMES=FILE2,                 <--- second OUTFIL statement
    INCLUDE=(84,15,ZD,LT,208,15,ZD),   <--- second OUTFIL statement
    BUILD=(C'T',1,239)                 <--- second OUTFIL statement


Your control statements with INREC worked because they have the correct syntax:

Code:

  SORT FIELDS=COPY
  INREC FIELDS(C'T',1,239)             <--- INREC statement
  OUTFIL FNAMES=FILE1,                 <--- first OUTFIL statement
    INCLUDE=(85,15,ZD,GE,209,15,ZD)    <--- first OUTFIL statement
  OUTFIL FNAMES=FILE2,                 <--- second OUTFIL statement
    INCLUDE=(85,15,ZD,LT,209,15,ZD)    <--- second OUTFIL statement
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 How to load to DB2 with column level ... DB2 6
No new posts Question for file manager IBM Tools 7
No new posts Db2 SQL - how to switch among differe... DB2 18
No new posts To search DB2 table based on Conditio... DB2 1
No new posts question for Pedro TSO/ISPF 2
Search our Forums:

Back to Top