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
 

 

Retaining old values in output file

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

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Mon Jul 14, 2008 12:15 pm    Post subject: Retaining old values in output file
Reply with quote

HI,

I want to extract the records from position 5 to 8 in input file and to place that records in position 15 of o/p file. I tried followg code. But it erases the old contents of o/p file from position 1 to 14. I want to retain that contents. How to do that?

Code:

//JSTP0010 EXEC PGM=SORT                     
//SORTIN   DD  DSN=DEV2.RK.TEST(@@CASE),     
//             DISP=SHR                     
//SORTOUT  DD  DSN=DEV2.RK.TEST(@@CASE1),   
//             DISP=SHR                     
//SORTWK01 DD  UNIT=SYSDA,SPACE=(CYL,20)     
//SYSOUT   DD SYSOUT=*                       
//SYSUDUMP DD SYSOUT=*                       
//SYSIN    DD *                             
  SORT FIELDS=COPY                           
  INREC FIELDS=(15:5,3)                     
//*                                         


Input file:

Code:

----+----1-
043800836 
047568288 
047568288 
047568288 
047568288 
047568288 
047568288 
048484353 
048484353 
048484353 


Output file:


Code:

----+----1----+----2
              008   
              682   
              682   
              682   
              682   
              682   
              682   
              843   
              843   
              843   



Regards
R KARTHIK
Back to top
View user's profile Send private message

Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Mon Jul 14, 2008 12:18 pm    Post subject: Reply to: Retaining old values in output file
Reply with quote

karthik,

Use this

Code:
//SYSIN    DD *                             
  SORT FIELDS=COPY                           
  INREC FIELDS=(1,14,15:5,3)                     
//*                     
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Mon Jul 14, 2008 12:30 pm    Post subject: Reply to: Retaining old values in output file
Reply with quote

Hi Aaru,

I think u wrongly understand my requirement. I did not want the contents from 1,14 of input file.

I will mention u clearly

Before execution

Input file:
Code:

----+----1--
043800836   
047568288   
047568288   
047568288   


Output file:
Code:

----+----1----
R KARTHIKEY
ANBUSELVANR   
KATHIRAVANR
VAIRAVANRAJ

After execution of sort card i want o/p like below

Input file:
Code:

----+----1--
043800836   
047568288   
047568288   
047568288   


Output file:
Code:

----+----1----+----2--
R KARTHIKEY   008
ANBUSELVANR   682   
KATHIRAVANR   682
VAIRAVANRAJ   682
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jul 14, 2008 12:51 pm    Post subject:
Reply with quote

Hello,

Quote:
I think u wrongly understand my requirement. I did not want the contents from 1,14 of input file.
Everyone would wrongly understand your requirement. . . This would be due to the way it was posted. You asked a question about relocating some data (or so it appeared).

Then out of nowhere/somewhere came some output with names - previously unmentioned.

Quote:
I will mention u clearly
When you do, please mention both input files. . . The dsorg and lrecl of the fles and any relevant fields should be mentoned as well as any rules for processing the inputs to get to the output you want.
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Mon Jul 14, 2008 1:13 pm    Post subject: Reply to: Retaining old values in output file
Reply with quote

Hi dick scherrer,

I understood my mistake. From now i will mention all details.

Here both the files are FB/133.

Regards
R KARTHIK
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 Jul 14, 2008 9:28 pm    Post subject:
Reply with quote

Karthik,

Here's a DFSORT/ICETOOL job that will do what you asked for.

Code:

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


IN1 is:

Code:

----+----1--
043800836
047568288
047568288
047568288


IN2 is

Code:

----+----1----+----2--
R KARTHIKEY
ANBUSELVANR
KATHIRAVANR
VAIRAVANRAJ


OUT will be:

Code:

----+----1----+----2--
R KARTHIKEY   008
ANBUSELVANR   682
KATHIRAVANR   682
VAIRAVANRAJ   682
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Tue Jul 15, 2008 11:45 am    Post subject: Reply to: Retaining old values in output file
Reply with quote

Hi Frank,

It's working now. Thanks for ur help.

Regards
R KARTHIK
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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm


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