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
 
Splitting & matching variable block file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Splitting & matching variable block file
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    Post subject:
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    Post subject: Reply to: Splitting & matching variable block file
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    Post subject:
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    Post subject: Reply to: Splitting & matching variable block file
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: 578
Location: USA

PostPosted: Tue Sep 14, 2010 8:30 pm    Post subject:
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    Post subject: Reply to: Splitting & matching variable block file
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

Site Director


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

PostPosted: Wed Sep 15, 2010 7:01 pm    Post subject:
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    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 Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm

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