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
 

 

Merge files vetically omiting spaces.

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

New User


Joined: 07 Jul 2005
Posts: 51

PostPosted: Mon Dec 05, 2005 10:29 am    Post subject: Merge files vetically omiting spaces.
Reply with quote

Hi,

I want to merge 2 fies vertically.But spaces should be omited.
Exampe:
file1:(FB - 80)
aaaa
bbbbbbb
cc

file2:(FB-100)
xxxxxxxxxx
yyyy
zz

Outfile:(FB-180)
aaaaxxxxxxxxxx
bbbbbbbyyyy
cczz

I have tried to mege these files using ICETOOL-SPICE which give me outfile:

Code:

0                                   81                                      180
aaaa                                xxxxxxxxxx
bbbbbbb                             yyyy
cc                                  zz


Please guide to some solution.(Can i get the needed output if I convet the input files to VB.)

Regards,
Pushpagiri.
Back to top
View user's profile Send private message

pushpagiri

New User


Joined: 07 Jul 2005
Posts: 51

PostPosted: Mon Dec 05, 2005 10:35 am    Post subject:
Reply with quote

Hi,

The format of outfile in above explanation is explained below.
0 81 180
aaaa xxxxxxxxxx
bbbbbbb yyyy
cc zz

this means that.
a - starts at 0. and 'x' starts at 81.So there are some spaces after 'aaaa' upto column 80.I want to omit these spaces.
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 Dec 05, 2005 9:20 pm    Post subject:
Reply with quote

Sort products do not have any built-in features for squeezing out blanks.
Back to top
View user's profile Send private message
pushpagiri

New User


Joined: 07 Jul 2005
Posts: 51

PostPosted: Thu Dec 08, 2005 11:09 am    Post subject:
Reply with quote

Hi,

I have solved this problem.But code is a bit complex one.
(Here both input are of LRECL = 80.You can change it as per your need)

Code:
//DFSORT   EXEC PGM=ICETOOL 
//TOOLMSG  DD SYSOUT=*       
//DFSMSG   DD SYSOUT=*                                           
//IN1  DD DSN=INPUT.PUSH.FILE1,DISP=SHR                         
//IN2  DD DSN=INPUT.PUSH.FILE2,DISP=SHR                         
//T1   DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)     
//TMP1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS) 
//OUT1 DD DSN=INPUT.PUSH.TEMP91,DISP=(NEW,CATLG,DELETE),         
//          DCB=(RECFM=FB,BLKSIZE=0,LRECL=80),UNIT=SYSDA,       
//          SPACE=(CYL,(10,5),RLSE)                             
//OUT2 DD DSN=INPUT.PUSH.TEMP92,DISP=(NEW,CATLG,DELETE),         
//          DCB=(RECFM=FB,BLKSIZE=0,LRECL=80),UNIT=SYSDA,       
//          SPACE=(CYL,(10,5),RLSE)                             
//OUT    DD DSN=OUTPUT.PUSH.FINAL99,DISP=(NEW,CATLG,DELETE),       
//          DCB=(RECFM=FB,BLKSIZE=0,LRECL=160),UNIT=SYSDA,       
//          SPACE=(CYL,(10,5),RLSE)                             
//TOOLIN   DD *                                         
    COPY FROM(IN1) TO(T1) USING(CPY1)                   
    COPY FROM(T1) TO(OUT1) USING(CPY2)                   
    COPY FROM(IN2) TO(T1) USING(CPY1)                   
    COPY FROM(T1) TO(OUT2) USING(CPY3)                   
    COPY FROM(OUT1) TO(TMP1) USING(CPY4)                 
    COPY FROM(OUT2) TO(TMP1) USING(CPY5)                 
    SPLICE FROM(TMP1) TO(OUT) ON(161,8,PD)-             
           WITHEACH WITH(81,80) USING(CPY6)             
/*                                                       
//CPY1CNTL DD *                                         
    OUTFIL FNAMES=T1,FTOV,VLTRIM=X'40'                   
/*                                                       
//CPY2CNTL DD *                                         
    OUTFIL FNAMES=OUT1,OUTREC=(1:5,80),                 
    VTOF,VLFILL=C'$'                                     
/*                                                       
//CPY3CNTL DD *                                         
    OUTFIL FNAMES=OUT2,OUTREC=(1:5,80),                         
    VTOF,VLFILL=C'$'                                           
/*                                                             
//CPY4CNTL DD *                                                 
    OUTREC FIELDS=(1:1,80,161:SEQNUM,8,PD)                     
/*                                                             
//CPY5CNTL DD *                                                 
    OUTREC FIELDS=(81:1,80,161:SEQNUM,8,PD)                     
/*                                                             
//CPY6CNTL DD *                                                 
   OUTFIL FNAMES=OUT,OUTREC=(1,160)                             
/*                                                             
//*STEP TO RUN REXX CODE FOR REMOVING '$'S AT END OF EACH FILE 
//STEPREXX EXEC PGM=IKJEFT01,PARM='REXREM$'                     
//SYSEXEC DD DISP=SHR,DSN=PUSH.REXXCODE.PDS                     
//SYSTSPRT DD SYSOUT=*                                         
//SYSTSIN DD DUMMY                                             
//FILELIST DD *                                                 
   OUTPUT.PUSH.FINAL99   
/*                   



Also a REXX code REXREM$ is used here.
To understand more about step STEPREXX, see the topic
http://ibmmainframes.com/viewtopic.php?t=7157

if it is hard to understand the code,see below :
Code:
Solution:
Step : DFSORT

f1: aaaa         ->out1:aaaa$$$$$$$$$$
f2: bbbbbb       ->out2:bbbbbb$$$$$$$$
(out1+out2)      ->tmp1:
aaaa$$$$$$$$$$                        00000001
                        bbbbbb$$$$$$$$00000001
SPICE(tmp1)   ->out:aaaa$$$$$$$$$$bbbbbb$$$$$$$$

Step : STEPREXX

Remove$(out)  ->out:aaaabbbbbb



If someone can optimise this code,please reply to this post.

Thanks to all who helped me.
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 28, 2006 2:03 am    Post subject:
Reply with quote

Quote:
Sort products do not have any built-in features for squeezing out blanks.


DFSORT now has the SQZ built-in function to squeeze out blanks. This new function is available with z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006). Here's the simplified DFSORT/ICETOOL job using SQZ for Push's requirement:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/80)
//IN2 DD DSN=...  input file2 (FB/100)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/180)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(181,8,ZD) WITH(81,100) USING(CTL3)
/*
//CTL1CNTL DD *
   OUTREC OVERLAY=(181:SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
   OUTREC BUILD=(81:1,100,181:SEQNUM,8,ZD)
/*
//CTL3CNTL DD *
   OUTFIL FNAMES=OUT,BUILD=(1,180,SQZ=(SHIFT=LEFT))
/*


For complete information on all of the new DFSORT and ICETOOL functions available with the April, 2006 DFSORT PTFs, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/
Back to top
View user's profile Send private message
pushpagiri

New User


Joined: 07 Jul 2005
Posts: 51

PostPosted: Mon May 01, 2006 6:38 pm    Post subject:
Reply with quote

Thankz for the info Frank


Regards,
Push.
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 Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm


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