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

Splitting & matching variable block file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ppandey07

New User


Joined: 27 Nov 2008
Posts: 51
Location: Delhi, India

PostPosted: Mon Sep 13, 2010 2:10 pm
Reply with quote

I have a transaction file which contains records like:

:20: IDC025/91889/10
:20: IGT001/17729/09
20C::CORP//4856711
20C::SEME//S10131000086830
20C::PREV//S09237000071115

I have a requirement wherein the input file would contain some values from above file, it would look like:

IDC025/91889/10
CORP//4856711
PREV//S09237000071115

I want to write a sortcard so that if the values in the input file match with the values in the transaction file than the entire transaction record gets copied to an output file. So the output file would look like:

:20: IDC025/91889/10
20C::CORP//4856711
20C::PREV//S09237000071115

Once above output file is created I want to write a 2nd sortcard which would match the output file values with another file (F2). F2 is a variable block file where a '$' sign indicates the start of a record. This is how couple of records in F2 look like:


${1:F01NWBKGB55DXXX2462330811}
{2:O0820901100511DZMNXXXXAXXX00007097091005111001S}
{4:
{202:0001}
{203:0001}
{171:100511}
{175:0900}
{301:RT}
{461:001}}
{5:
{CHK:0C00C5B30333}
{SYS:}}
${1:F01NWBKGB2LEXXX3423623510}
{2:O2021549100511CIBEEGCXA08540214264501005111349N}
{4:
:20: IDC025/91889/10
:21:BMOC45027677
:32A:100511GBP21816,70
:53B:/04509676
:58A:BARCGB2102L
-}
{5:
{CHK:42C505A4ABD0}}

The output created by the 2nd sortcard should have the entire record from F2 wherein values in the output file created above matches with values in F2. The file would look like:

${1:F01NWBKGB2LEXXX3423623510}
{2:O2021549100511CIBEEGCXA08540214264501005111349N}
{4:
:20: IDC025/91889/10
:21:BMOC45027677
:32A:100511GBP21816,70
:53B:/04509676
:58A:BARCGB2102L
-}
{5:
{CHK:42C505A4ABD0}}
Back to top
View user's profile Send private message
smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Mon Sep 13, 2010 3:21 pm
Reply with quote

wud u mind changing the fields that are getting matched to bold
Back to top
View user's profile Send private message
ppandey07

New User


Joined: 27 Nov 2008
Posts: 51
Location: Delhi, India

PostPosted: Mon Sep 13, 2010 3:32 pm
Reply with quote

I've changed the fields getting matched to BOLD.

-----------------------------------------------------------
I have a transaction file which contains records like:

:20: IDC025/91889/10
:20: IGT001/17729/09
20C::CORP//4856711
20C::SEME//S10131000086830
20C::PREV//S09237000071115

I have a requirement wherein the input file would contain some values from above file, it would look like:

IDC025/91889/10
CORP//4856711
PREV//S09237000071115


I want to write a sortcard so that if the values in the input file match with the values in the transaction file than the entire transaction record gets copied to an output file. So the output file would look like:

:20: IDC025/91889/10
20C::CORP//4856711
20C::PREV//S09237000071115


Once above output file is created I want to write a 2nd sortcard which would match the output file values with another file (F2). F2 is a variable block file where a '$' sign indicates the start of a record. This is how couple of records in F2 look like:


${1:F01NWBKGB55DXXX2462330811}
{2:O0820901100511DZMNXXXXAXXX00007097091005111001S}
{4:
{202:0001}
{203:0001}
{171:100511}
{175:0900}
{301:RT}
{461:001}}
{5:
{CHK:0C00C5B30333}
{SYS:}}
${1:F01NWBKGB2LEXXX3423623510}
{2:O2021549100511CIBEEGCXA08540214264501005111349N}
{4:
:20: IDC025/91889/10
:21:BMOC45027677
:32A:100511GBP21816,70
:53B:/04509676
:58A:BARCGB2102L
-}
{5:
{CHK:42C505A4ABD0}}

The output created by the 2nd sortcard should have the entire record from F2 wherein values in the output file created above matches with values in F2. The file would look like:

${1:F01NWBKGB2LEXXX3423623510}
{2:O2021549100511CIBEEGCXA08540214264501005111349N}
{4:
:20: IDC025/91889/10
:21:BMOC45027677
:32A:100511GBP21816,70
:53B:/04509676
:58A:BARCGB2102L
-}
{5:
{CHK:42C505A4ABD0}}
Back to top
View user's profile Send private message
smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Tue Sep 14, 2010 12:22 pm
Reply with quote

please mention RECFM and LRECL of all 3 files
Back to top
View user's profile Send private message
ppandey07

New User


Joined: 27 Nov 2008
Posts: 51
Location: Delhi, India

PostPosted: Tue Sep 14, 2010 1:34 pm
Reply with quote

these are variable block files
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Tue Sep 14, 2010 8:30 pm
Reply with quote

Pankaj,
For the transaction file,does your matching field always start at certain position? If yes, please provide the same.
For the input file,does it only contain matching fields for the transaction file? If yes, starting position for the field?
What is the maximum length of the matching field for both the file?

For the F2 (Variable block file), what is the starting position and maximum length for the matching field?

Also,please use code tags. It helps others understand the input data.

Thanks,
Back to top
View user's profile Send private message
ppandey07

New User


Joined: 27 Nov 2008
Posts: 51
Location: Delhi, India

PostPosted: Wed Sep 15, 2010 9:46 am
Reply with quote

sqlcode1,

In the transaction file, the matching field would start from the 16th byte however the length is not fixed since it's a variable block file. The first 15bytes are fixed.

The input file contains matching fields + some more transaction data and as this is also a variable block file so don't know the starting point.

No idea about the maximum length of the matching field as it's a variable block file.

In F2 also we don't know the starting position and maximum length as it's a variable block file.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Sep 15, 2010 7:01 pm
Reply with quote

Hello,

If "nothing" is known, how might any code be written at all. . . icon_confused.gif

The first requirement about any kind of code is to know the rules. This is true with assembler, cobol, and utilities (i.e. the sort).

If you cannot describe the rules i don't know how anyone can help. . .
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top