Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Insert values from one file to another file.

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

New User


Joined: 16 Oct 2006
Posts: 80
Location: chennai

PostPosted: Fri Aug 10, 2012 5:16 pm    Post subject: Insert values from one file to another file.
Reply with quote

Hi,
I would like to extract and include data from one file record to another file record in multiple positions based on condition. Please find below for the problem details.

input file 1
------------
LENGTH(200),RECFM=FB

Code:

(1,7),SPACE,(9,4),SPACE,(14-4),SPACE,(19,4),SPACE,(24,4),SPACE,(29,4),168SPACE,
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
RECORD1 0001 0005 0002 0003 0002
RECORD2 0005 0001 0003 0002 0005
RECORD3 0003 0001 0002 0001
RECORD4 0002 0005 0004 0003 0001
RECORD5 0001 0003 0002 0001
RECORD6 0003 0001 0002 0001 0005


input file 2
--------------
LENGTH(80),RECFM=FB

Code:

(1,4),SPACE,(6,10),66SPACE
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
0005 AAAAAAAAAA
0001 CCCCCCCCCC
0003 HHHHHHHHHH
0004 DDDDDDDDDD

0007 YYYYYYYYYY
0002 BBBBBBBBBB
0010 RRRRRRRRRR
0006 UUUUUUUUUU


Expected output file:
---------------------
LENGTH=100,RECFM=FB
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
RECORD1 0001 CCCCCCCCCC 0005 AAAAAAAAAA 0002 BBBBBBBBBB 0003 HHHHHHHHHH 0002 BBBBBBBBBB
RECORD2 0005 AAAAAAAAAA 0001 CCCCCCCCCC 0003 HHHHHHHHHH 0002 BBBBBBBBBB 0005 AAAAAAAAAA
RECORD3 0003 HHHHHHHHHH 0001 CCCCCCCCCC 0002 BBBBBBBBBB 0001 CCCCCCCCCC
RECORD4 0002 BBBBBBBBBB 0005 AAAAAAAAAA 0004 DDDDDDDDDD 0003 HHHHHHHHHH 0001 CCCCCCCCCC
RECORD5 0001 CCCCCCCCCC 0003 HHHHHHHHHH 0002 BBBBBBBBBB 0001 CCCCCCCCCC
RECORD6 0003 HHHHHHHHHH 0001 CCCCCCCCCC 0002 BBBBBBBBBB 0001 CCCCCCCCCC 0005 AAAAAAAAAA


I walk thru the below mentioned link which is similar to my requirement and it was not worked after I did some changes in the code. Please help me on this. Thanks in Advance.

http://ibmmainframes.com/about53227.html

-Nath.
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1542
Location: Andromeda Galaxy

PostPosted: Fri Aug 10, 2012 6:57 pm    Post subject:
Reply with quote

Nath,

Being in forum for 6 years you never helped yourself?

You never told us what was the problem you got?

Show us the job , control cards, sysout or error messages you got?
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: Fri Aug 10, 2012 6:57 pm    Post subject:
Reply with quote

Hello,

What did you change? What happened?

You need to post the jcl and sort control statements used as well as the informational output generated by your run.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Aug 10, 2012 10:44 pm    Post subject:
Reply with quote

rguhanath,

Use the following DFSORT JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DISP=SHR,DSN=Your Input 200 byte file1
//SORTOUT  DD DSN=&&TMP,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)
  SORT FIELDS=COPY                                         
  INREC OVERLAY=(40:SEQNUM,8,ZD)                           
  OUTFIL BUILD=(40,8,C'1',1,7,08,5,/,                       
                40,8,C'2',1,7,13,5,/,                       
                40,8,C'3',1,7,18,5,/,                       
                40,8,C'4',1,7,23,5,/,                       
                40,8,C'5',1,7,28,5)                         
//*                                       
//STEP0200 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//INA      DD DSN=&&TMP,DISP=SHR                           
//INB      DD DISP=SHR,DSN=Your Input 80 byte file2
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                           
  JOINKEYS F1=INA,FIELDS=(18,4,A)                         
  JOINKEYS F2=INB,FIELDS=(01,4,A)                         
  JOIN UNPAIRED,F1                                         
  REFORMAT FIELDS=(F1:1,21,F2:5,11)                       
  SORT FIELDS=(1,9,CH,A)                                   
                                                           
  OUTREC IFOUTLEN=108,IFTHEN=(WHEN=INIT,BUILD=(101:1,32)),
  IFTHEN=(WHEN=GROUP,BEGIN=(109,1,ZD,EQ,1),               
  PUSH=(01:110,8,118,4,122,11),RECORDS=5),                 
  IFTHEN=(WHEN=GROUP,BEGIN=(109,1,ZD,EQ,2),               
  PUSH=(24:117,5,122,11),RECORDS=4),                       
  IFTHEN=(WHEN=GROUP,BEGIN=(109,1,ZD,EQ,3),               
  PUSH=(40:117,5,122,11),RECORDS=3),                       
  IFTHEN=(WHEN=GROUP,BEGIN=(109,1,ZD,EQ,4),               
  PUSH=(56:117,5,122,11),RECORDS=2),                       
  IFTHEN=(WHEN=(109,1,ZD,EQ,1),OVERLAY=(24:77X)),         
  IFTHEN=(WHEN=(109,1,ZD,EQ,2),OVERLAY=(40:60X)),         
  IFTHEN=(WHEN=(109,1,ZD,EQ,3),OVERLAY=(56:44X)),         
  IFTHEN=(WHEN=(109,1,ZD,EQ,4),OVERLAY=(72:28X)),         
  IFTHEN=(WHEN=(109,1,ZD,EQ,5),OVERLAY=(72:117,5,122,11)) 
                                                           
  OUTFIL REMOVECC,NODETAIL,BUILD=(100X),                   
  SECTIONS=(101,8,TRAILER3=(1,100))                       
//*
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 Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us