IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Matching two files with different LRECL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pinkroses

New User


Joined: 07 Nov 2005
Posts: 19

PostPosted: Mon Sep 04, 2006 3:40 pm
Reply with quote

Hi,

I have a requirement like this

First file: LRECL 10
Second file: LRECL 175

I have to match position 1,9 from both files and copy the file2 record to o/p record.I have to check the position 10 in file1 for character 'C' and if it is TRUE then i have to change the change the value of position (40,4) in file2.

This changed one should be a output record.

Can anyone help me regarding this?
Back to top
View user's profile Send private message
vicky10001
Warnings : 1

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Mon Sep 04, 2006 3:53 pm
Reply with quote

Please Explain what need to do?
1.Need to write cobol program
2.Need to wirte sort(Dfsort ..etc)
Back to top
View user's profile Send private message
pinkroses

New User


Joined: 07 Nov 2005
Posts: 19

PostPosted: Mon Sep 04, 2006 4:22 pm
Reply with quote

Need to write sort only
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Sep 04, 2006 9:29 pm
Reply with quote

pinkroses,

Please show an example of the records in your input files and the expected output records (just show the relevant fields). If input file1 can have duplicates within it (on positions 1-9), show that in your example. If input file2 can have duplicates within it (on positions 1-9), show that in your example.

Also, indicate exactly what you want 40,4 changed to when position 10 is 'C'.
Back to top
View user's profile Send private message
pinkroses

New User


Joined: 07 Nov 2005
Posts: 19

PostPosted: Tue Sep 05, 2006 9:25 am
Reply with quote

Frank,

No duplicates in both input records.

First record with LRECL 10: Format
AAA000000
AAA000006N
AAA000014N

Second record with LRECL 175: format. some of the fields are comp-3 values.
(1 to 12)AAC001010AAC

(32 to 46)D010101UCUSTYND other are comp-3 values'

If the first file conatins value 'C' in its tenth position i have to change the value of position (40,4) to eg ('CUST in above record) to 'PROP'
Back to top
View user's profile Send private message
pinkroses

New User


Joined: 07 Nov 2005
Posts: 19

PostPosted: Tue Sep 05, 2006 9:27 am
Reply with quote

Frank,

Output record will be of same format (LRECL :175)as second input file with changed value.

Thanks in advance,
pinkroses
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Sep 05, 2006 9:26 pm
Reply with quote

Your example seems to have nothing to do with your words - I can't make heads or tails of it.

You say you "have to match position 1,9 from both files" but none of the records in file1 have the same value in positions 1-9 as the record in file2. File1 has AAA000000, AAA000006 and AAA000014, whereas file2 has AAC001010 - no match.

You say "If the first file conatins value 'C' in its tenth position", but none of the records in file1 has a C in its tenth position.

You need to step back and think about what you want to do, explain it and show me an example of input and output records that matches the explanation.
Back to top
View user's profile Send private message
pinkroses

New User


Joined: 07 Nov 2005
Posts: 19

PostPosted: Wed Sep 06, 2006 8:08 pm
Reply with quote

Frank,

No duplicates in both input records.

First record with LRECL 10: Format
AAA000000
AAA000006N
AAA000014C

Second record with LRECL 175: format. some of the fields are comp-3 values.
(1 to 12)AAA000014AAA

(32 to 46)D010101UPROPND other are comp-3 values'

If the first file conatins value 'C' in its tenth position i have to change the value of position (40,4) to eg ('PROP in above record) to 'PBKR'
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Sep 06, 2006 9:21 pm
Reply with quote

I wish you had given a better example with matching records that have 'C' and don't have 'C' and shown the expected output. I'm going to guess that for the output file, you only want the records from file2 that have a match in file1. So if you had this:

File1 input
Code:

AAA000000   
AAA000006N 
AAA000014C 
AAA000020X 


File2 input
Code:

AAA000014AAA                   D010101UPROPND 
AAA000020AAA                   D010101UPROPND 


You'd want the following:

Output
Code:

AAA000014AAA                   D010101UPBKRND
AAA000020AAA                   D010101UPROPND


Here's a DFSORT/ICETOOL job to do that:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/10)
//IN2 DD DSN=...  input file2 (FB/175)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/175)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,9,CH) WITH(1,175) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(176:10,1)
/*
//CTL2CNTL DD *
  INREC OVERLAY=(176:C' ')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,
    IFOUTLEN=175,
    IFTHEN=(WHEN=(176,1,CH,EQ,C'C'),OVERLAY=(40:C'PBKR'))
/*
Back to top
View user's profile Send private message
pinkroses

New User


Joined: 07 Nov 2005
Posts: 19

PostPosted: Thu Sep 07, 2006 11:19 am
Reply with quote

Thanks for the reply frank.
But am getting an error and the sysout reads

Code:
                                   
  OPTION COPY                               
  INREC OVERLAY=(176:10,1)                   
        *                                   
WER428I  CALLER-PROVIDED IDENTIFIER IS "0001"
WER268A  INREC STATEMENT   : SYNTAX ERROR   
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Back to top
View user's profile Send private message
IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Thu Sep 07, 2006 4:15 pm
Reply with quote

Oooops,
Pinkroses - I do believe that you have just incurred the wrath of Khan!

Expect the following from the master later today;
--
I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
--

All that effort and you are using a different tool.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Sep 07, 2006 9:55 pm
Reply with quote

pink,

The job works fine with DFSORT, but the WER messages indicate you're using Syncsort, not DFSORT.

Quote:
Pinkroses - I do believe that you have just incurred the wrath of Khan!


No wrath - just sadness. icon_sad.gif

Quote:
Expect the following from the master later today;


What he said.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts 3 files concatenated to 1 DFSORT/ICETOOL 2
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts OpenPGP Decryption job getting LRECL ... IBM Tools 7
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts WER247A SORTOUT HAS INCOMPATIBLE LRECL SYNCSORT 7
Search our Forums:

Back to Top