Page 1 of 1

Selective block copy

PostPosted: Thu Jun 20, 2013 11:28 am
by novice_always
Hi,

I have got a requirement to retrieve selective block of data from a file. Like to know if anyone have got an idea in doing this using SORT.

Input file format. Consists of one main Header(0000)
and another common header(0010) for all accounts(ABC, XYZ,IJK,YUI).

0000
0010
1000 ABC
1000
3000
3000
|
|

0010
1000 XYZ
2000
2000
3000
3000
|
|
0010
1000 IJK
2000
3000
3000
|
|
0010
1000 YUI
2000
3000




My other input file has keys XYZ and YUI. This is present in record with sub-header(1000)


So my end file should only copy blocks have XYZ and YUI. I tried WHEN=GROUP, but could not
get resultant output. Any help

OUTPUT FILE
-------------------
0010
1000 XYZ
2000
2000
3000
3000
|
|
0010
1000 YUI
2000
3000

Thanks in advance

Re: Selective block copy

PostPosted: Thu Jun 20, 2013 11:55 pm
by BillyBoyo
Does the 1000 always follow the 0010? Only one 1000 per 0010?

Also, what is the RECFM/LRECL of your input files? Length of the account key?

Re: Selective block copy

PostPosted: Fri Jun 21, 2013 1:08 pm
by novice_always
Sorry for the confusion created. the first block shuld have
0000
0010
1000 ABC
2000
3000
3000
Yes, 1000 always follow 0010. All account have one 1000 per 0010.

RECFM is VB and LRECL is 996.
Length of acct key is 9 digits.

Re: Selective block copy

PostPosted: Fri Jun 21, 2013 10:35 pm
by skolusu
novice_always wrote:My other input file has keys XYZ and YUI. This is present in record with sub-header(1000)


novice_always,

Please answer the following questions.

1. What is the LRECL and RECFM of the 2nd file which has the keys
2. Show us a sample input of that file
3. Are there any duplicates in that 2nd file?
4. Last but not least run the following job and show us the complete sysout, which will help us determine the level of DFSORT you are running.
//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*   
//SORTIN   DD *         
//SORTOUT  DD SYSOUT=*   
//SYSIN    DD *         
  OPTION COPY           
//*