MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with BUILD with OUTFIL clause

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
raveendra_ibm
Beginner


Joined: 02 Apr 2006
Posts: 32
Topics: 10

PostPosted: Mon Jul 23, 2007 4:16 am    Post subject: Problem with BUILD with OUTFIL clause Reply with quote

Hi All,

I am trying to analyse where did this go wrong. Could you please help me out on this.

Code:
//STEP01   EXEC PGM=SORT                               
//SORTIN   DD DSN=MYID.SORT.INPUT.VB1204,
//            DISP=SHR                                 
//SORTOUT  DD DSN=MYID.SORT.OUTPUT.FB80,           
//            DISP=(OLD,KEEP,KEEP)                     
//SYSOUT   DD  SYSOUT=*                               
//SYSPRINT DD  SYSOUT=*                               
//SYSABEND DD  SYSOUT=*                               
//SYSUDUMP DD  SYSOUT=*                               
//SYSIN    DD *                                                     
  INCLUDE COND=(12,1,PD,EQ,5,OR,12,1,PD,EQ,9)                       
  SORT FIELDS=(1,8,PD,A)                                           
  OUTFIL IFTHEN=(WHEN=(12,1,PD,EQ,5),                               
          BUILD=(X'1C',2:5,7,33,2,80,2,89,2,401,1,498,2,537,4,541,4,
                 417,1,515,3,106,1,559,3,47X))                     
/*                                                                 

INPUT file = MYID.SORT.INPUT.VB1204
Key = 1 Bytes PD + 3 Bytes PD + 4 Bytes PD = 8 Bytes
LRECL = 1204
RECFM = VB

OUTPUT file = MYID.SORT.OUTPUT.FB80
Key = 1 Bytes PD + 3 Bytes PD + 4 Bytes PD = 8 Bytes (same as input)
LRECL = 80
RECFM = FB

TERMINATED WITH ABENDU0126
ICE126A 9 INCONSISTENT SORTOUT IFTHEN 1 REFORMATTING FIELD FOUND

Please let me know if I need to provide more details on the same.

Thanks,
Raveendra.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Jul 23, 2007 6:39 am    Post subject: Reply with quote

Quote:

TERMINATED WITH ABENDU0126
ICE126A 9 INCONSISTENT SORTOUT IFTHEN 1 REFORMATTING FIELD FOUND

raveendra_ibm,

You are only checking for a single value in the IFTHEN condition.Your include condition picks all the records which have a '5' or '9' at pos 12. You only coded an IFTHEN statement for '5' , what about '9'? . That is exactly why the SORT failed here.

You either need to code another IFTHEN statement for '9' or Use another include/omit condition to strip them off. Also your Input is VB you need to consider the RDW when sorting and if you want an FB file you need to use FTOV or convert feature



Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Mon Jul 23, 2007 6:42 am    Post subject: Reply with quote

After looking at the error in the z/OS V1R8.0 DFSORT Messages, Codes and Diagnosis Guide this might have some bearing:
Quote:
The first field was not 1,n where n is equal to or greater than 4, for variable-length input records, that is, the first field did not contain the record descriptor word (RDW).
How would "BUILD=(1:X'1C'...." work?
Back to top
View user's profile Send private message
raveendra_ibm
Beginner


Joined: 02 Apr 2006
Posts: 32
Topics: 10

PostPosted: Mon Jul 23, 2007 7:09 am    Post subject: Reply with quote

Hi Kolusu,

Tried out the following also... same result Sad

Code:
//SYSIN    DD *
  OPTION COPY                                                       
  INCLUDE COND=(12,1,PD,EQ,0,OR,12,1,PD,EQ,5)                       
  OUTFIL VTOF,                                                       
         IFTHEN=(WHEN=(12,1,PD,EQ,0),                               
           BUILD=(12,1,22,5,31,5,49,3,66X)),                         
         IFTHEN=(WHEN=(12,1,PD,EQ,5),                               
           BUILD=(X'1C',2:5,7,33,2,80,2,89,2,401,1,498,2,537,4,541,4,
                  417,1,515,3,106,1,559,3,47X))                     
/*                                                                   


Hi CICS Guy,

Quote:
How would "BUILD=(1:X'1C'...." work?


I think this should work because we are building a FB record. VTOF is in place. Correct me if I am wrong.

Thanks,
Raveendra.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Jul 23, 2007 8:00 am    Post subject: Reply with quote

raveendra_ibm,

Try these control cards
Code:

//SYSIN    DD *
  OPTION COPY                                                       
  INCLUDE COND=(12,1,PD,EQ,0,OR,12,1,PD,EQ,5)                       
  OUTREC IFTHEN=(WHEN=(12,1,PD,EQ,0),                               
           BUILD=(1,4,12,1,22,5,31,5,49,3,66X)),                         
         IFTHEN=(WHEN=(12,1,PD,EQ,5),                               
           BUILD=(1,4,X'1C',5,7,33,2,80,2,89,2,401,1,498,2,537,4,541,4,
                  417,1,515,3,106,1,559,3,47X))
  OUTFIL VTOF,BUILD=(5,80)                     
/*               

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
raveendra_ibm
Beginner


Joined: 02 Apr 2006
Posts: 32
Topics: 10

PostPosted: Mon Jul 23, 2007 8:46 am    Post subject: Reply with quote

Hi Kolusu,

Thanks a lot. This works !!!

But just wanted to know what went wrong in the previous case ? Finding difficult to convince myself.... Rolling Eyes

Thanks,
Raveendra.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Jul 23, 2007 9:11 am    Post subject: Reply with quote

raveendra_ibm,

The OUTFIL BUILD is processed before OUTFIL VTOF. For variable-length records, the first entry in the OUTREC, BUILD or IFTHEN BUILD parameter must specify or include the unedited 4-byte record descriptor word (RDW), that is, the first field must be 1,4 or 1,m with m greater than 4. DFSORT sets the length of the reformatted record in the RDW.

So I used the OUTREC to process the RDW and on OUTFIL I removed the RDW

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
raveendra_ibm
Beginner


Joined: 02 Apr 2006
Posts: 32
Topics: 10

PostPosted: Mon Jul 23, 2007 9:18 am    Post subject: Reply with quote

Thank you Kolusu...

That was the learning of the day...

Regards,
Raveendra.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Jul 23, 2007 10:47 am    Post subject: Reply with quote

Quote:
For variable-length records, the first entry in the OUTREC, BUILD or IFTHEN BUILD parameter must specify or include the unedited 4-byte record descriptor word (RDW), that is, the first field must be 1,4 or 1,m with m greater than 4. DFSORT sets the length of the reformatted record in the RDW.


Actually, that's NOT true when VTOF is used. With VTOF, you specify the fixed length fields to be used for output. You would not specify the RDW unless you want it included in the FB output records. The fact that OUTFIL VTOF,BUILD=(5,80) works shows that the RDW is not needed with VTOF.

Here's an analysis of what really went on here:

raveendra's first job - trying to convert from VB to FB, but missing VTOF. Without VTOF, the RDW must be specified in the BUILD operand. It wasn't, so the error message was issued.

raveendra's second job - VTOF specified. IFTHEN is NOT allowed with VTOF. That's the reason for the error message. It has nothing to do with not having the RDW in the BUILD operand.

Kolusu's job - works because it avoids using IFTHEN with VTOF. Has the RDW in the OUTREC BUILD as required. Has OUTFIL VTOF and BUILD without the RDW which is fine.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
raveendra_ibm
Beginner


Joined: 02 Apr 2006
Posts: 32
Topics: 10

PostPosted: Mon Jul 23, 2007 1:04 pm    Post subject: Reply with quote

Now thats from the Master !!!

Thanks a lot for the clarification Frank.

Thank you CICS Guy, Kolusu and Frank for your time and thoughts....

Regards,
Raveendra.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group