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
 

 

Replace values in the input data

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

New User


Joined: 19 Apr 2017
Posts: 3
Location: india

PostPosted: Thu May 11, 2017 2:18 pm    Post subject: Replace values in the input data
Reply with quote

Hi
I have Two input files

Input File 1
Code:
 AAA BBB CCC DDDD
PPP PPP QQQ SSSS
EEE FFF GGG HHHH
KKK LLL MMM NNNN
SSS TTT SSS JJJJ
FLD(7,2) == '03',
FLD(7,2) == '04',
FLD(7,2) == '05',
FLD(7,2) == '06',
FLD(7,2) == '07',
XYZ XYX XXX     
PQR MNO         


Input file 2
Code:
12
13
14
15
16


Output file
Code:
AAA BBB CCC DDDD
PPP PPP QQQ SSSS
EEE FFF GGG HHHH
KKK LLL MMM NNNN
SSS TTT SSS JJJJ
FLD(7,2) == '12',
FLD(7,2) == '13',
FLD(7,2) == '14',
FLD(7,2) == '15',
FLD(7,2) == '16',
XYZ XYX XXX     
PQR MNO         

I want to replace records using JCL . kindly help me to get expected output.
Thanks in advance!!!
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10272
Location: italy

PostPosted: Thu May 11, 2017 3:00 pm    Post subject: Reply to: Need Help of Jcl
Reply with quote

show us what You have done to help Yourself,

a forum is for help...
no for just dropping a problem and asking for a solution
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1804
Location: UK

PostPosted: Thu May 11, 2017 3:02 pm    Post subject:
Reply with quote

Well, you may want to use JCL and I do not see what problem you are having as the JCL required to run DFsort is explained in the DFsort manual. But JCL by itself cannot do what you want - you need utility, in this case DFsort, control statements. So what have you tried so far (you are in the expert's forum not the Beginners so you should have tried something)?

Please use the code tags when posting code and data and note that on the mainframe data is held in data sets not files.
(I was going to edit your posgt to make it use the code tags but I see that Enrico got there first!)
Back to top
View user's profile Send private message
Vikas Maharnawar

New User


Joined: 19 Apr 2017
Posts: 3
Location: india

PostPosted: Thu May 11, 2017 3:18 pm    Post subject: Reply to: Need Help of Jcl
Reply with quote

I written below JCl

Code:
//STEP01   EXEC  PGM=ICETOOL                                         
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN1      DD DSN=XYZ,DISP=SHR                             
//IN2      DD DSN=PQR,DISP=SHR                           
//TEMP     DD DSN=&&TEMP,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT      DD DSN=ABC,DISP=(NEW,CATLG,DELETE),                           
//           DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),                   
//           UNIT=3390,SPACE=(TRK,(10,10),RLSE)                     
//TOOLIN   DD *                                                       
 COPY FROM(IN1) TO(TEMP) USING(CTL1)                                 
 COPY FROM(IN2) TO(TEMP) USING(CTL2)                                 
 SPLICE FROM(TEMP) TO(OUT) ON(81,2,ZD) WITH(14,02) USING(CTL3)       
//CTL1CNTL DD *                                                       
 INREC BUILD=(1,17,81:SEQNUM,2,ZD)                                   
/*                                                                   
//CTL2CNTL DD *                                                       
 INREC BUILD=(14:1,02,81:SEQNUM,2,ZD)                                 
/*                                                                   
//CTL3CNTL DD *                                                       
 OUTFIL FNAMES=OUT,BUILD=(1,80)
 /*                   

Job gives below Output to me
Code:
AAA BBB CCC D12D
PPP PPP QQQ S13S
EEE FFF GGG H14H
KKK LLL MMM N15N
SSS TTT SSS J16J


Coded - again
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1804
Location: UK

PostPosted: Thu May 11, 2017 3:49 pm    Post subject:
Reply with quote

3 things:

1 - learn to use the code tags - use the full reply editor not the quick reply.
2 - the experts will probably say that you should use JOINKEYS - look in the forum for various examples.
3 - you probably should not provide DCB info on your output DD name.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2278
Location: @my desk

PostPosted: Thu May 11, 2017 8:12 pm    Post subject:
Reply with quote

Are the contents of your input-1 static?
Will there be the same number of records in input-1, each time?
Will there be the same number of records in input-2, each time?

Like Nic pointed out, you might be able to achieve this without SPLICEing.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1720
Location: NY,USA

PostPosted: Thu May 11, 2017 10:24 pm    Post subject:
Reply with quote

With the given input, this will work.
Code:

----+----1----+----2----+
//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*   
//INA      DD *         
AAA BBB CCC DDDD         
PPP PPP QQQ SSSS         
EEE FFF GGG HHHH         
KKK LLL MMM NNNN         
SSS TTT SSS JJJJ         
FLD(7,2) == '03',       
FLD(7,2) == '04',       
FLD(7,2) == '05',       
FLD(7,2) == '06',       
FLD(7,2) == '07',       
XYZ XYX XXX             
PQR MNO                 
//INB      DD *         
12                       
13                       
14                       
15                       
16                       
//SORTOUT  DD SYSOUT=*   
//SYSIN    DD *                                       
  SORT FIELDS=COPY                                   
  JOINKEYS F1=INA,FIELDS=(25,2,A),SORTED,NOSEQCK                   
  JOINKEYS F2=INB,FIELDS=(25,2,A),SORTED,NOSEQCK                     
  JOIN UNPAIRED,F1                                   
  REFORMAT FIELDS=(F1:1,20,F2:1,2,?)                 
  OUTREC IFOUTLEN=20,                                 
  IFTHEN=(WHEN=(14,2,CH,EQ,C'03'),OVERLAY=(14:21,2)),
  IFTHEN=(WHEN=(14,2,CH,EQ,C'04'),OVERLAY=(14:21,2)),
  IFTHEN=(WHEN=(14,2,CH,EQ,C'05'),OVERLAY=(14:21,2)),
  IFTHEN=(WHEN=(14,2,CH,EQ,C'06'),OVERLAY=(14:21,2)),
  IFTHEN=(WHEN=(14,2,CH,EQ,C'07'),OVERLAY=(14:21,2)) 
//JNF1CNTL DD *                                       
  INREC OVERLAY=(25:SEQNUM,2,ZD)                     
//JNF2CNTL DD *                                       
  INREC OVERLAY=(25:SEQNUM,2,ZD,START=6,INCR=1)       
//*     
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 376
Location: USA

PostPosted: Fri May 12, 2017 1:13 am    Post subject: Reply to: Replace values in the input data
Reply with quote

Rohit,

I modified your card a little so that the result is not dependent on input values, rather on some input key (in this case position 1-3 = FLD).

Code:
//SYSIN DD *
  SORT FIELDS=COPY
  JOINKEYS F1=INA,FIELDS=(25,2,A),SORTED,NOSEQCK
  JOINKEYS F2=INB,FIELDS=(25,2,A),SORTED,NOSEQCK
  JOIN UNPAIRED,F1
  REFORMAT FIELDS=(F1:1,20,F2:1,2,?)
  OUTREC IFOUTLEN=20,
  IFTHEN=(WHEN=(1,3,CH,EQ,C'FLD'),OVERLAY(14:21,2))
//JNF1CNTL DD *
  INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'FLD'),OVERLAY=(25:SEQNUM,2,ZD))
/*
//JNF2CNTL DD *
  INREC OVERLAY=(25:SEQNUM,2,ZD)
/*
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1720
Location: NY,USA

PostPosted: Fri May 12, 2017 12:51 pm    Post subject:
Reply with quote

RahulG31, much better way of doing it. Thanks.
Back to top
View user's profile Send private message
Vikas Maharnawar

New User


Joined: 19 Apr 2017
Posts: 3
Location: india

PostPosted: Fri May 12, 2017 3:27 pm    Post subject: Reply to: Replace values in the input data
Reply with quote

It works successfully.
Thank you all of you for giving your valuable time and helping me. icon_smile.gif
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1720
Location: NY,USA

PostPosted: Sat May 13, 2017 3:04 am    Post subject:
Reply with quote

Welcome here!.
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 SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am
No new posts Need input in Scheduling Benchwarmer CA Products 5 Tue Jun 06, 2017 1:44 am
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm


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