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
 
How to build one file from two input files

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

New User


Joined: 26 Feb 2018
Posts: 2
Location: italy

PostPosted: Tue Feb 27, 2018 6:45 pm    Post subject: How to build one file from two input files
Reply with quote

Hi,
I need to generate one file taking different fields from two different input files.
Here an example:

INPUT FILE 1: 1234 ABCDE A1B2C3D4

INPUT FILE 2: 5678 FGHIL E1F2G3H4

OUTPUT FILE: A1B2C3D4 FGHIL 1234 5678 E1F2G3H4 ABCDE

Is it possible using some of DFSORT features?
I was thinking about OUTREC but can't manage to get any result.

Thanks for your help

Daniele
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8697
Location: Back in jolly old England

PostPosted: Tue Feb 27, 2018 7:58 pm    Post subject:
Reply with quote

Welcome to the forum

You need to describe in far more detail what is actually wanted.
What are the rules for getting from input to output.
Field lengths, positions and data types.

We can guess from the post above, but it is far better to get the description right first time to avoid responders wasting time on an incorrect solution.

Please also post the code that you have tried and the results.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2033
Location: UK

PostPosted: Tue Feb 27, 2018 7:59 pm    Post subject:
Reply with quote

Joinkeys?
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


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

PostPosted: Tue Feb 27, 2018 8:55 pm    Post subject:
Reply with quote

Since there is no key, it is 1-1 match assumed, so make sure records are sorted correctly.
considering the size FB 80 , try this.
Code:
//STEP0100 EXEC PGM=SORT                                 
 //SYSOUT   DD SYSOUT=*                                   
 //SORTJNF1 DD DSN=DS1,DISP=SHR         
 //SORTJNF2 DD DSN=DS2,DISP=SHR           
 //SORTOUT  DD SYSOUT=*                                   
 //SYSIN    DD *                                           
   SORT FIELDS=COPY                                       
   JOINKEYS FILE=F1,FIELDS=(81,8,A),SORTED,NOSEQCK       
   JOINKEYS FILE=F2,FIELDS=(81,8,A),SORTED,NOSEQCK         
   REFORMAT FIELDS=() << Adjust it as per your needs shown above                     
 //JNF1CNTL DD *                                           
   INREC OVERLAY=(81:SEQNUM,8,ZD)                         
 //JNF2CNTL DD *                                           
   INREC OVERLAY=(81:SEQNUM,8,ZD)                         
 //*

Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Wed Feb 28, 2018 1:21 am    Post subject: Reply to: How to build one file from two input files
Reply with quote

If it is only one record in both the files, then you dont need a Joinkey.

You can concatenate both the files and use IFTHEN=(WHEN=GROUP,BEGIN=..) and PUSH=..

And use OUTFIL INCLDUE to read only second record and build the required fields.
Back to top
View user's profile Send private message
daniele

New User


Joined: 26 Feb 2018
Posts: 2
Location: italy

PostPosted: Wed Feb 28, 2018 3:20 pm    Post subject:
Reply with quote

Hi,
thank you all for your kind replies.Excuse me if i have not explained my needs very clearly.
My input data sets are sequential text data sets (lrecl=80,recfm=fb), here an extract from both:

INPUT 1:

Code:
09720170000000106284000000000000001F730SZ614572496393RM0010972017000000010628412
09720170000000267268000000000000001G293SZ614572496405RM0010972017000000026726812
09720170000000310378000000000000001L182SZ614572496416RM0040972017000000031037812
09720170000000406308000000000000001C518SZ614572496428RM0060972017000000040630812
09720170000000506309000000000000001H387SZ614572496439RM0060972017000000050630912
09720170000000606315000000000000001L611SZ614572496440RM0060972017000000060631512
09720170000000710375000000000000001E392SZ614572496451RM0040972017000000071037512

INPUT 2:

Code:
0972017000017904147000000000000001F730SZ614572496393RM0010972017000001790414744I
09720170000018016347000000000000001F604SZ614572498180LE0010972017000001801634765
09720170000018116633000000000000001F842SZ614572498191LE0010972017000001811663376
09720170000018216282000000000000001H632SZ614572498203LE0010972017000001821628283
09720170000018316725000000000000001L064SZ614572498214LE0010972017000001831672503
09720170000018416499000000000000001F784SZ614572498226TA00109720170000018416499A3
09720170000018506856000000000000001G252SZ614572498237TA0010972017000001850685659


My need is to generate a third data set having the same structure (lrecl=80,recfm=fb)
each record composed in this way:(byte 1 to 10 from first input),(byte 11 to 30 from second input),
(byte 31 to 60 from first input),(byte 61 to 80 from second input):

Code:
09720170000179041470000000000000001F730SZ614572496393RM001072017000001790414744I
09720170000018016347000000000000001G293SZ614572496405RM0010972017000001801634765
09720170000018116633000000000000001L182SZ614572496416RM0040972017000001811663376
09720170000018216282000000000000001C518SZ614572496428RM0060972017000001821628283
09720170000018316725000000000000001H387SZ614572496439RM0060972017000001831672503
09720170000018416499000000000000001L611SZ614572496440RM00609720170000018416499A3
09720170000018506856000000000000001E392SZ614572496451RM0040972017000001850685659


Thanks
D

Edited to use code tags and proper terminology
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 IKJEFT1B - Cant send 2 files with bot... Time2Live TSO/ISPF 1 Thu Jul 19, 2018 4:56 am
No new posts Need Help to Create 4 Output Records ... satish.ms10 DFSORT/ICETOOL 4 Thu Jul 19, 2018 1:55 am
No new posts finding anydata between positions of ... ram_vizag SYNCSORT 13 Tue Jul 17, 2018 9:14 pm
No new posts KSDS file fields update by passing va... Anil Kumar Prajapati TSO/ISPF 5 Wed Jul 11, 2018 5:59 am
No new posts Comparing inside same file vickey_dw DFSORT/ICETOOL 2 Tue Jul 10, 2018 9:51 pm

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