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
 

 

Copy a file backup into flat file

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

New User


Joined: 24 May 2010
Posts: 86
Location: Pune

PostPosted: Mon May 23, 2011 5:46 pm    Post subject: Copy a file backup into flat file
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

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon May 23, 2011 6:07 pm    Post subject:
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 Moderator


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

PostPosted: Mon May 23, 2011 10:46 pm    Post subject:
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:

http://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: 86
Location: Pune

PostPosted: Tue May 24, 2011 1:31 pm    Post subject: Copy a file backup into flat file
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 Moderator


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

PostPosted: Tue May 24, 2011 10:40 pm    Post subject:
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    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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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