Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

A typical BLOCKS OF RECORDS Selection Criterion.

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

New User


Joined: 21 Oct 2011
Posts: 16
Location: India

PostPosted: Sat Nov 05, 2011 2:33 pm    Post subject: A typical BLOCKS OF RECORDS Selection Criterion.
Reply with quote

Hi,

I have an Input File, say, FILE A, (LRECL=80 and RECFM=FB) which contains BLOCKS OF RECORDS. A Particular BLOCK OF RECORD would have 11 Records.

I am having another Input File, say, FILE B (LRECL=80 and RECFM=FB). This Input FILE B also contains BLOCKS OF RECORDS, each BLOCK OF RECORD again consisting of 11 Records. The structure of the BLOCKS OF RECORDS in both the Input FILE A and FILE B is exactly the same.

NOTE: - The Input File B would have much more number of BLOCKS OF RECORDS than the Input FILE A.

Code:

AAP11003029M-[b]MPSMAS614EDDFWMKK0411111413TO1827271361[/b] 9
8207  702729220727485---+++7290651521136913201921  211
081261333635300)011377497000000000000000027A0827A0827A
631452037459311619291 117 171505 63431360150112 239242
22///11 145519070299 1656532 344441348 908 939 7986 66
14499 64081370030004  36262  99   74 857  488  0100004
2 334431348 909 934 8077 66514527:::::312319318 178:::
  98   88 846  501  41000044///10 145519070299 1656533
81451637004313319359 170 115494 63501360040004 173254
2///11 145519070299 1656519 48493143814401439143915181
9                                                     


(1) I am reading column 14 to 52 of the 1st record of the last BLOCK OF RECORD present in the Input FILE A, as highlighted in BOLD above.

(2) I have to scan through the Input FILE B sequentially from the Top and whenever I encounter the last BLOCK OF RECORD present in the 1st Input FILE A,
I need to write out all subsequent BLOCKS OF RECORDS from the Input FILE B to an Output File, say, FILE C.

How could this be acheived through DFSORT?
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Sat Nov 05, 2011 3:54 pm    Post subject: Reply to: A typical BLOCKS OF RECORDS Selection Criterion.
Reply with quote

And what have you tried? You've had solutions for three different "block" requirements, can't you even make an attempt at it yourself?

Also, re-read your post. It is entirely unclear either what your "column" is, or what you want to do with it.
Back to top
View user's profile Send private message
Subhasish Sarkar

New User


Joined: 21 Oct 2011
Posts: 16
Location: India

PostPosted: Sat Nov 05, 2011 4:56 pm    Post subject: Reply to: A typical BLOCKS OF RECORDS Selection Criterion.
Reply with quote

Basically, the idea is to write to an Output FILE C, only those BLOCKS OF RECORDS from the Input FILE B which appear below the last BLOCK OF RECORD present in the Input File A.

The last BLOCK OF RECORD present in the Input FILE A is also present somewhere in the Input FILE B and all those BLOCKS OF RECORDS in the Input FILE B that appear below this last BLOCK OF RECORD from the Input File A should get written into the Output File.

Note that the sequence of Records in either of the two Input Files cannot be changed.

And, the unique key to identify an entire BLOCK OF RECORD is column 14 to 52 of the 1st record of each BLOCK OF RECORD (consisting of a total of 11 records).

Do let me know if the information provided is still unclear.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Sat Nov 05, 2011 5:12 pm    Post subject: Reply to: A typical BLOCKS OF RECORDS Selection Criterion.
Reply with quote

Let's see if I got it.

You have a "key" which is at a particular position on the first record of a block. The key is unique within file A and file B.

You have to take the key of the last record of file A, find that key in the correct position on file B and then write everything after that block to file C.

In which case, you can make the temporary records for file A, as previously shown, obtain the last record from that file, extract the key, generate a symname with that value, to feed into the next step which makes the temporary records for file B then only starts the copy once the key on the symname is reached, from which point you do the chopping-up of the temporary record back to its original 11 constituents.

You could just zip through file B without making the temporary file, but you'd run the risk of finding the "key" in some other place than the first record of a block. It is a highly unlikely situation, which means it'll happen on the second production run if you don't deal with it correctly.

Obviously this is not a solution, but an outline of a solution. You could have a crack at it yourself, or just sit around and wait.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Sat Nov 05, 2011 5:30 pm    Post subject: Reply to: A typical BLOCKS OF RECORDS Selection Criterion.
Reply with quote

Quote:
A typical BLOCKS OF RECORDS Selection Criterion.


nothing typical ...
just a confusing description of a more confusing requirement icon_evil.gif
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: Sat Nov 05, 2011 11:06 pm    Post subject: Reply to: A typical BLOCKS OF RECORDS Selection Criterion.
Reply with quote

Hello,

And is most similar to another topic about "blocks". . . icon_neutral.gif

http://ibmmainframes.com/viewtopic.php?t=56647

d
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Sat Nov 05, 2011 11:11 pm    Post subject: Reply to: A typical BLOCKS OF RECORDS Selection Criterion.
Reply with quote

Four "blocks" topics in 15 days. I suppose it might seem "typical" to TS. Also typical is quality of information.

Having received several "blocks" solutions already, I'm keen to see what has been usefully absorbed, rather than dribbled down the chin :-)
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Tue Nov 08, 2011 12:24 am    Post subject:
Reply with quote

Subhasish Sarkar,
Quote:
(1) I am reading column 14 to 52 of the 1st record of the last BLOCK OF RECORD present in the Input FILE A, as highlighted in BOLD above.

(2) I have to scan through the Input FILE B sequentially from the Top and whenever I encounter the last BLOCK OF RECORD present in the 1st Input FILE A,
I need to write out all subsequent BLOCKS OF RECORDS from the Input FILE B to an Output File, say, FILE C.



Please provide better example of your sample input data and expected output. Try to cover all the possible scenarios. What do you mean by all the subsequent blocks of records. Did you mean until End Of File?

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

DFSORT Moderator


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

PostPosted: Tue Nov 08, 2011 1:10 am    Post subject:
Reply with quote

Subhasish Sarkar,

If I understand correctly what you want to do, you can use a DFSORT/ICETOOL job like the following. STEP1 sets up a symbol for your key from the last block of file1. STEP2 adds group ids and sequence numbers to the blocks in file2 and sets up a symbol for the target id (group id that has your key). STEP3 writes all of the records from file2 with group ids greater than the target id to the output file.

Code:

//STEP1 EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/80)
//S1 DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//TOOLIN DD *
SUBSET FROM(IN1) TO(S1) INPUT KEEP LAST(11) USING(CTL1)
//CTL1CNTL DD *
  OUTFIL FNAMES=S1,ENDREC=1,
    BUILD=(C'TARGKEY,''',14,39,C'''',80:X)
//STEP2 EXEC  PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input file2 (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//S2 DD DSN=&&S2,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,RECORDS=11,PUSH=(81:ID=8,SEQ=8))
  OUTFIL FNAMES=T1
  OUTFIL FNAMES=S2,
    INCLUDE=(89,8,ZD,EQ,1,AND,14,39,CH,EQ,TARGKEY),
    BUILD=(C'TARGID,+',81,8,80:X)
//STEP3 EXEC  PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S2,DISP=(OLD,PASS)
//SORTIN DD DSN=&&T1,DISP=(OLD,PASS)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN DD *
  OPTION COPY
  INCLUDE COND=(81,8,ZD,GT,TARGID)
  INREC BUILD=(1,80)
/*
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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us