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
 

 

Need help in Overlay

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Wed Feb 11, 2009 7:17 pm    Post subject: Need help in Overlay
Reply with quote

Hi,

Code:

----+----1----+----2----+----3----+--
<FILE DSN="F3698TWH.TEST.XMLDS1">   
  <PD-OUTPUT-RECORD RECORD="00001"> 
    <PD-REC-DES>HD4</PD-REC-DES>     


Here I just want to change where "<FILE" comes yhen the 6 field should come as >.

I tried the following code,
Code:

//SYSIN    DD *                             
  SORT FIELDS=COPY                           
  OUTREC IFTHEN=(WHEN=(1,5,CH,EQ,C'<FILE'), 
                     OVERLAY=(6:C'>'))       
/*                                           


But I'm getting the output same as the input, meaning it's not changing.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Feb 11, 2009 7:22 pm    Post subject:
Reply with quote

What is the record format?
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Wed Feb 11, 2009 8:39 pm    Post subject:
Reply with quote

Hi,

The record Format is VB.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Feb 11, 2009 8:44 pm    Post subject:
Reply with quote

You forgot that in VB, the data starts in position 5, leaving 1-4 for the record length (llbb).....Try OUTREC IFTHEN=(WHEN=(5,5,CH,EQ,
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Wed Feb 11, 2009 11:07 pm    Post subject:
Reply with quote

William is right. For VB, it would be:

Code:

//SYSIN    DD *                             
  SORT FIELDS=COPY                           
  OUTREC IFTHEN=(WHEN=(5,5,CH,EQ,C'<FILE'), 
                     OVERLAY=(10:C'>'))       
/*     
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Thu Feb 12, 2009 10:02 am    Post subject:
Reply with quote

Hi William/Frank,

Thanks for your help.

Its working fine now.
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Thu Feb 12, 2009 10:45 am    Post subject:
Reply with quote

Hi all,

Just one more help,

Code:

----+----1----+----2----+----3----+--
<FILE DSN="F3698TWH.TEST.XMLDS1">   
  <PD-OUTPUT-RECORD RECORD="00001"> 
    <PD-REC-DES>HD4</PD-REC-DES>



I used the below code,

Code:

//SYSIN    DD *                             
  SORT FIELDS=COPY                           
  OUTREC IFTHEN=(WHEN=(5,5,CH,EQ,C'<FILE'), 
                     OVERLAY=(5:C'>'))       
/*     


and got the output as below,

Code:

----+----1----+----2----+----3----+--
>FILE DSN="F3698TWH.TEST.XMLDS1">   
  <PD-OUTPUT-RECORD RECORD="00001"> 
    <PD-REC-DES>HD4</PD-REC-DES>



But i need to squeeze the whole "<FILE". So the output should come as below,

Code:

----+----1----+----2----+----3----+--
>DSN="F3698TWH.TEST.XMLDS1">   
  <PD-OUTPUT-RECORD RECORD="00001"> 
    <PD-REC-DES>HD4</PD-REC-DES>



So i tried with the code as below,

Code:

  SORT FIELDS=COPY                                           
  INREC FINDREP=(INOUT=(C'<FILE ',C'>'))


But i m getting the error message as "PARAMETER 'FINDREP' IS UNIDENTIFIED. ".

Could you guys please suggest any other trick to do the same.

Thanks in advance.
Back to top
View user's profile Send private message
km_abdullah

New User


Joined: 03 Nov 2008
Posts: 60

PostPosted: Thu Feb 12, 2009 11:22 am    Post subject:
Reply with quote

Hi Niki,

What version of DFSORT you use? FINDREP is available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008).

Alternatively, for your requirement code as below -

Code:
//SYSIN DD *                             
 SORT FIELDS=COPY                         
 OUTREC IFTHEN=(WHEN=(1,5,CH,EQ,C'<FILE'),
 OVERLAY=(1:C'>',7,74))                   
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Thu Feb 12, 2009 11:27 am    Post subject:
Reply with quote

Hi Mohamed Abdullah,

Thanks for the help.
I got my required Output.
Back to top
View user's profile Send private message
km_abdullah

New User


Joined: 03 Nov 2008
Posts: 60

PostPosted: Thu Feb 12, 2009 11:27 am    Post subject:
Reply with quote

One correction,
The starting position in OUTREC & OVERLAY should be changed as per your requirement to '5' not '1'. Please correct it.

i.e.,

Code:
//SYSIN DD *                             
 SORT FIELDS=COPY                         
 OUTREC IFTHEN=(WHEN=(5,5,CH,EQ,C'<FILE'),
 OVERLAY=(5:C'>',11,70))     
Back to top
View user's profile Send private message
km_abdullah

New User


Joined: 03 Nov 2008
Posts: 60

PostPosted: Thu Feb 12, 2009 11:46 am    Post subject:
Reply with quote

You are welcome. Glad to help you...
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Thu Feb 12, 2009 9:52 pm    Post subject:
Reply with quote

Actually, you didn't give the correct solution.

Using OVERLAY like that for a VB file will pad the records with blanks instead of keeping them as variable length.

The correct way to do what Niki asked for is with a DFSORT job like this:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (VB)
//SORTOUT DD DSN=...  output file (VB)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(5,5,CH,EQ,C'<FILE'),
    BUILD=(1,4,5:C'>',11))
/*
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Fri Feb 13, 2009 4:27 pm    Post subject:
Reply with quote

Hi Frank/Abdullah,

Thanks u guys for the help.
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 Overlay with right shift Bill Woodger DFSORT/ICETOOL 3 Thu Jan 28, 2016 7:49 pm
No new posts Overlay with WHEN=Group not working krsenthil85 DFSORT/ICETOOL 7 Wed Oct 21, 2015 4:00 am
No new posts Merge two files with some replace/ove... dheeraj.ramchandani DFSORT/ICETOOL 10 Thu Sep 03, 2015 7:59 pm
No new posts OVERLAY several fields if non-blank autobox DFSORT/ICETOOL 5 Fri Jul 10, 2015 12:42 pm
No new posts Question on IFTHEN and OVERLAY Statem... narein207 DFSORT/ICETOOL 3 Tue Oct 21, 2014 11:03 pm


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