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

how to split the one field in to multiple fields using jcl


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
somapradeep1

New User


Joined: 07 Sep 2010
Posts: 22
Location: hyderabad

PostPosted: Fri Apr 20, 2012 5:27 pm
Reply with quote

HI,

One of my file one field ex: comb id .its length in the copy book is s9(9)comp-3.my req is to split the field in to two fields ex: comb1 id2
the data also should be split. pls help me in this problem.....

Example:

Code:

i/p

combid (PD)
123456789
456892356
898564236

o/p
combid (PD)    comb1 (ZD)    id2 (ZD)
123456789      12345         06789
456892356      45689         02356
898564236      89856         04326
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: Fri Apr 20, 2012 10:42 pm
Reply with quote

somapradeep1,

This is a bit tricky because PD values have a sign in the last nibble. So your PD value of 123456789 is X'123456789C' in hex (5 bytes) and you want to split it into two ZD values of 12345 (5 bytes) and 06789 (5 bytes). Let's assume that your original PD value is in positions 1-5 and you want the first ZD value in positions 11-15 and the second ZD value in positions 21-25. You can use a DFSORT job like the following:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB)
//SORTOUT DD DSN=...  output file (FB)
//SYSIN DD *
  OPTION COPY                                                     
  INREC IFTHEN=(WHEN=INIT,                                         
    OVERLAY=(11:1,3,PD,TO=ZD,LENGTH=5,                             
      21:3,3,PD0,TO=ZD,LENGTH=5)),                                 
    IFTHEN=(WHEN=(11,5,ZD,LT,0),                                   
      OVERLAY=(11:11,5,ZD,MUL,-1,TO=ZD,LENGTH=5))                 


If that's not what you want, then you need to do a better job of explaining exactly what it is you do want.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
Search our Forums:

Back to Top