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

Copy a file backup into flat file


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

New User


Joined: 24 May 2010
Posts: 92
Location: Pune

PostPosted: Mon May 23, 2011 5:46 pm
Reply with quote

I am trying to copy a file backup into flat file and updated the output file with '1' in MTRKCLI0-MONTH-END-KEY as

Code:
                                                             
//STEP5 EXEC PGM=SORT                                               
//SORTIN   DD DISP=SHR,DSN=TR.SD.MON.MTRK.G0239V00,   
//            UNIT=VTAPE                                             
//SORTOUT  DD DSN=XMTRV.TEST.COREMPP.MASTER.MTRKCLI.PS,             
//             DISP=(,CATLG,DELETE),                             
//             UNIT=DISK,                                           
//             SPACE=(CYL,(500,500),RLSE)                                                             
//*                                               
//SYSOUT   DD SYSOUT=*                                               
//SYSIN DD *                                                         
  OPTION COPY                                                   
  INCLUDE COND=((5,3,CH,EQ,C'KSC'),OR,                               
                (5,3,CH,EQ,C'XXX'))                                 
  OUTREC FIELDS=(1,233,234:X'00',235:X'1C',236,1969)                 
/*   



Characteristics of TR.SD.MON.MTRK.G0239V00 -

RECFM = VB ,LRECL = 2204

I am copying few records from this file into flat file and updating the flat file field which is as -

Month-End-key Binary 3 ,Starting Position - 234


When I am running this job,it copies the record properly but dont update the output file with '1'


Thanks!
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon May 23, 2011 6:07 pm
Reply with quote

You say you want to put a '1' in a field. This implies a 1-byte printable character. Is this field a 1-byte ZD field in position 235 or a 2-byte PD field starting at position 234? If the former, your control card is putting a 1-byte PD rather than a 1-byte ZD value at that location.

Garry.
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: Mon May 23, 2011 10:46 pm
Reply with quote

Quote:
Month-End-key Binary 3 ,Starting Position - 234


What exactly does this mean? Does it mean a 3-byte binary value starting in position 234 or something else? How does that correspond to the X'001C' value you're overlaying? That would be a 2-byte PD 1. A 2-byte binary 1 would be X'0001'. A 3-byte binary 1 would be X'000001'. You need to figure out what you really want and let us know before we can help you.

BTW, since your records are VB, it would be better to use 236 as the last position for the variable part of the record, rather than using 236,1969 (a fixed field) as the last field.

Alternatively, you could use OVERLAY to just overlay the bytes you want instead of using BUILD to rebuild the entire record.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
Back to top
View user's profile Send private message
kishpra

New User


Joined: 24 May 2010
Posts: 92
Location: Pune

PostPosted: Tue May 24, 2011 1:31 pm
Reply with quote

It means 3-byte binary value starting in position 234
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 24, 2011 10:40 pm
Reply with quote

Then you can use:

Code:

    OUTREC OVERLAY=(234:X'000001')       


or

Code:

    OUTREC OVERLAY=(234:+1,TO=BI,LENGTH=3)       
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top