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

Get all those ps contents in to one ps and in the same row


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

DFSORT Developer


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

PostPosted: Sun Nov 26, 2006 10:07 pm
Reply with quote

First of all, subhasis's version of the job is not the best way to do it. It's overcomplicated. Here's a better version:

Code:

//S1 EXEC PGM=ICETOOL                                                 
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN1      DD *                                                       
56789                                                                 
BBBBB                                                                 
CCCCC                                                                 
/*                                                                   
//IN2      DD *                                                       
11111                                                                 
22222                                                                 
33333                                                                 
/*                                                                   
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)         
//OUT      DD SYSOUT=*                                               
//TOOLIN   DD *                                                       
COPY FROM(IN1) TO(T1) USING(CTL1)                                     
COPY FROM(IN2) TO(T1) USING(CTL2)                                     
SPLICE FROM(T1) TO(OUT) ON(81,8,ZD) WITH(6,5) USING(CTL3)             
//CTL1CNTL DD *                                                       
  INREC OVERLAY=(81:SEQNUM,8,ZD)                                     
//CTL2CNTL DD *                                                       
  INREC BUILD=(6:1,5,81:SEQNUM,8,ZD)                                 
/*                                                                   
//CTL3CNTL DD *                                                       
  OUTFIL FNAMES=OUT,BUILD=(1,80)                                     
/*                                                                   


The CTL1CNTL INREC statement adds a sequence number to each IN1 record in positions 81-88.

The CNTL2CNTL INREC statement puts IN2 positions 1-5 at output positions 6-10 and adds a sequence number in positions 81-88.

Here's what the T1 records look like after the two COPY operators are used:

Code:

56789       ...    00000001
BBBBB       ...    00000002
CCCCC       ...    00000003
     11111  ...    00000001
     22222  ...    00000002
     33333  ...    00000003



New the SPLICE operator creates a spliced record for each pair of sequence numbers with the 1-5 field from the first record and the 6-10 field from the second record. The OUTFIL statement removes the sequence number.
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 Conditional step execution based on P... JCL & VSAM 9
No new posts Prblem with mail having MIME contents JCL & VSAM 2
No new posts Consolidating and summing file contents SYNCSORT 14
No new posts Read contents of PS file JCL & VSAM 3
No new posts Combining contents of 2 files in to s... SYNCSORT 1
Search our Forums:

Back to Top