Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 92
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

Senior Member


Joined: 08 May 2006
Posts: 1002
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: 92
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 ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us