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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: how to split the one field in to multiple fields using jcl
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 Moderator


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

PostPosted: Fri Apr 20, 2012 10:42 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am


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