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 

Overlay with Build

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


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Thu Dec 10, 2009 9:39 am    Post subject: Overlay with Build Reply with quote

Hi,

I am trying to use OVERLAY and BUILD together in SORT.

Code:

//STEP0001 EXEC PGM=SORT                             
//SORTIN   DD *                                       
    41XXXXXXXXXX                                     
    42YYYYYYYYY                                       
//SORTOUT  DD  SYSOUT=*                               
//SYSOUT   DD SYSOUT=*                               
//SYSIN    DD  *                                     
  OPTION COPY                                         
  INREC IFTHEN=(WHEN=(16,1,CH,EQ,C' '),BUILD=(6:5,11),
                OVERLAY=(5:C'0'))                     
//*                                                   


But job fails with "U0016". Is it not allowed to code two parms together?

Please suggest.

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Thu Dec 10, 2009 12:32 pm    Post subject: Reply with quote

BUILD and OVERLAY are not allowed together in the same IFTHEN clause. You can use them in separate IFTHEN clauses or you can use multiple items in one BUILD or in one OVERLAY. I don't really know what you're trying to do with that IFTHEN clause, so I can't tell you how to fix it.

If you want more help, tell me what you're trying to do. Show the expected output for your input example and explain the rules for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input file and output file.
_________________
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
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Fri Dec 11, 2009 6:33 am    Post subject: like this Reply with quote

Thank you Frank.

I am able to achieve it with below code:

Code:

//STEP0001 EXEC PGM=SORT                                     
//SORTIN   DD *                                             
    41XXXXXXXXXX                                             
    42YYYYYYYYY                                             
//SORTOUT  DD  SYSOUT=*                                     
//SYSOUT   DD SYSOUT=*                                       
//SYSIN    DD  *                                             
  OPTION COPY                                               
  INREC IFTHEN=(WHEN=(16,1,CH,EQ,C' '),BUILD=(5:C'0',6:5,11))
//*                                                         

_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Mon Dec 14, 2009 8:18 am    Post subject: Possible to achieve with OUTFIL? Reply with quote

Hi,

I am just curious to know if this could be achieved using OUTFIL method? I tried a lot but could not succeed. This is just a kind request to experts.

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Mon Dec 14, 2009 12:44 pm    Post subject: achieved it. Reply with quote

I achieved it.

Code:

//STEP0003 EXEC PGM=SYNCTOOL                             
//IN       DD *                                         
    41XXXXXXXXXX                                         
    42YYYYYYYYY                                         
//OUT1     DD DSN=&&T1,DISP=(NEW,PASS,DELETE),UNIT=SYSDA
//OUT2     DD DSN=&&T2,DISP=(MOD,PASS,DELETE),UNIT=SYSDA
//OUT3     DD SYSOUT=*                                   
//TOOLMSG  DD SYSOUT=*                                   
//SSMSG    DD SYSOUT=*                                   
//TOOLIN   DD *                                         
  COPY FROM(IN) TO(OUT1) USING(MFU1)                     
  COPY FROM(OUT1) TO(OUT2) USING(MFU2)                   
  COPY FROM(OUT1) TO(OUT2) USING(MFU3)                   
  COPY FROM(OUT2) TO(OUT3) USING(MFU4)                   
//MFU1CNTL DD *                                         
  INREC OVERLAY=(20:SEQNUM,8,ZD)                         
//MFU2CNTL DD *                                         
  INCLUDE COND=(16,1,CH,NE,C' ')                         
//MFU3CNTL DD *                                         
  OUTFIL FNAMES=OUT2,INCLUDE=(16,1,CH,EQ,C' '),OUTREC=(5:C'0',6:5,11,
                              20:20,8,80:X)                         
//MFU4CNTL DD *                                                     
  SORT FIELDS=(20,8,ZD,A)                                           
  OUTREC FIELDS=(1,19)                                               
/*                                                                   


Note:
This attempt does not make any sense when simplified solutions are already worked out. This is just to see if workaround was possible !

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Mon Dec 14, 2009 5:08 pm    Post subject: Reply with quote

MF,
In the future, please indicate which set of Sort products your site is using. DFSORT, Syncsort, CA-Sort, or whatever. The solutions may vary depending on your product.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Mon Dec 14, 2009 5:39 pm    Post subject: Reply with quote

Quote:
I am just curious to know if this could be achieved using OUTFIL method? I tried a lot but could not succeed


I don't know what you mean by "an OUTFIL method" or what you were actually trying to do. The original poster used

Code:

  INREC IFTHEN=(WHEN=(16,1,CH,EQ,C' '),BUILD=(5:C'0',6:5,11))


OUTFIL instead of INREC would have worked as well. I suspect you're trying to do something else, but you haven't explained what so I don't know if your "solution" is an efficient one or not, although I suspect whatever it is you're trying to do doesn't really require four passes.
_________________
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
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Tue Dec 15, 2009 10:36 am    Post subject: Reply with quote

Hi,

I am trying to realign the input data as shown in output using OUTFIL. The requirement is to put a '0' in 5th column and move data from 5th column onwards to 6th column if 16th column is blank.

Input - LRECL=80,RECFM=FB
Code:

----+----1----+----2
    41XXXXXXXXXX
    42YYYYYYYYY 


Output - LRECL=80,RECFM=FB
Code:

----+----1----+----2
    41XXXXXXXXXX
    042YYYYYYYYY


Thanks Frank.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
Brian Wood
Beginner


Joined: 14 Jan 2009
Posts: 37
Topics: 0
Location: USA

PostPosted: Tue Dec 15, 2009 3:44 pm    Post subject: Reply with quote

MF:

I have restricted the below coding example to the specifics of your latest posting. I have coded an OUTFIL statement which uses IFTHEN to detect if the byte in position 16 is a blank; if it is a blank, a record is built that contains the first 4 bytes of the record, followed by a zero, followed by the remainder of the record, displaced by one byte to compensate for the inserted zero. Please note that the last byte (if any) of the 80-byte input record would be truncated whenever the byte in position 16 is a blank.

Code:
//STEP01 EXEC PGM=SYNCSORT                   
//SORTOUT  DD  SYSOUT=*                                     
//SORTIN   DD *                                             
    41XXXXXXXXXX                                             
    42YYYYYYYYY                                             
/*                                                           
//SYSOUT DD SYSOUT=*                                         
//SYSIN  DD *                                               
  SORT FIELDS=COPY                                           
  OUTFIL FILES=OUT,                                         
         IFTHEN=(WHEN=(16,1,CH,EQ,C' '),                     
                 BUILD=(1:1,4,5:C'0',6:5,75))


This produces the following output:
Code:
    41XXXXXXXXXX
    042YYYYYYYYY


Please contact me if you require further assistance with this matter.
_________________
Brian Wood
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
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