|
View previous topic :: View next topic
|
| Author |
Message |
rohitpb
New User
Joined: 04 Jan 2006 Posts: 5
|
|
|
|
I have input file of Length 25004 and want Selective Fields from the files.
I have following SYSIN coded
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=SOUT0,
INCLUDE=(875,2,PD,EQ,+004),
OUTREC=(1:153,40,2X,60,4)
Need to check Packed decimal value 4 at position 871.
The include condition is coded after adding four (VB file requirement).
However not a single record satisfying the condition is obtained though the file contains such records. I feel the problem is in Packed Decimal format (PD) comparisson. It would be great and helpful if anybody can provide a solution. |
|
| Back to top |
|
 |
prabs2006
Active User
Joined: 12 Jan 2006 Posts: 103
|
|
|
|
Hi,
Can you please provide us the Pic clause of that variable?
S9(X)v9(X) comp-3 ..provide the value of X here.
T & R
Prabs |
|
| Back to top |
|
 |
prabs2006
Active User
Joined: 12 Jan 2006 Posts: 103
|
|
|
|
Hi,
On the second thought I wanted you to check with 04 rather than 004.
T & R
Prabs |
|
| Back to top |
|
 |
rohitpb
New User
Joined: 04 Jan 2006 Posts: 5
|
|
|
|
| prabs2006 wrote: |
Hi,
On the second thought I wanted you to check with 04 rather than 004.
T & R
Prabs |
Hey Prabs,
I put in all the possible combinations of 4 but with same results. The Pic clause is S999 comp3. |
|
| Back to top |
|
 |
pkmainframe
New User
Joined: 14 Jun 2005 Posts: 16 Location: India
|
|
|
|
Hi Rohit,
I ran teh same condition on a sample VB file with the below code
SORT FIELDS=COPY
INCLUDE COND=(14,2,PD,EQ,+004)
Its working fine my dataset looks like below
----+----1----+----2
aaaaaaaa .<
88888888404
1111111100C
-------------------
bbbbbbbb .*
88888888405
2222222200C [/img]
in case if it doesn't then you have to check your data !
dump few records into a vb file and browse !
Thanks
Kumar |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Something's wrong here. You say you have a VB input file, but you show your OUTFIL statement as:
| Code: |
OUTFIL FNAMES=SOUT0,
INCLUDE=(875,2,PD,EQ,+004),
OUTREC=(1:153,40,2X,60,4)
|
That OUTREC parameter would result in an error message for a VB file, because 1,4 must be included in the first field and it isn't. So that would lead to the conclusion that you actually have an FB file, not a VB file, which would mean that you have the wrong position for the PD field.
Check the SYSOUT messages. They'll tell you if the input file is FB or VB.
If it's really VB, then I don't see how you managed to get that OUTREC parameter to work. |
|
| Back to top |
|
 |
rajandhla
Active User
.jpg)
Joined: 18 Oct 2005 Posts: 182 Location: Luton UK
|
|
|
|
hi,
here i have got small doubt, if i have a VSAM file has record length
has minimun 87 and maximum has 1000 bytes.
so whether i should treat as variable file or fixed file.
if it is variable file then i should include 4 bytes to every position used in the include control card.
regards
jai |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
| Back to top |
|
 |
rajandhla
Active User
.jpg)
Joined: 18 Oct 2005 Posts: 182 Location: Luton UK
|
|
|
|
Hi,
Sorry, i will see next time it won't be repeated.
U mean for the sortin input file we need to specify(add) 4 bytes to the positions that we want to check the conditions like in include control card. sort won't add 4 bytes automatically to positions during comarision/checking condition.
Please confirm me.
Thanks
Jai |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Jai,
Did you read the doc at the link I gave above. It answers your questions. I'll quote the relevant section here:
| Quote: |
Variable-length processing: An RRDS, KSDS, ESDS or VRRDS can always be processed as variable-length. For VSAM input, DFSORT reads each record and prepends a record descriptor word (RDW) to it. For VSAM output, DFSORT removes the RDW before writing each record. Since DFSORT uses an RDW in positions 1-4 to process variable-length records, the data starts in position 5. Control statement positions should be specified accordingly.
|
As it says, for variable record processing, you need to add 4 to the starting position of the fields you specify to account for the RDW that DFSORT adds to each input record. Put another way, for variable processing the first data byte starts in position 5, whereas for fixed processing the first data byte starts in position 1. |
|
| Back to top |
|
 |
rohitpb
New User
Joined: 04 Jan 2006 Posts: 5
|
|
|
|
| Frank Yaeger wrote: |
Something's wrong here. You say you have a VB input file, but you show your OUTFIL statement as:
| Code: |
OUTFIL FNAMES=SOUT0,
INCLUDE=(875,2,PD,EQ,+004),
OUTREC=(1:153,40,2X,60,4)
|
That OUTREC parameter would result in an error message for a VB file, because 1,4 must be included in the first field and it isn't. So that would lead to the conclusion that you actually have an FB file, not a VB file, which would mean that you have the wrong position for the PD field.
Check the SYSOUT messages. They'll tell you if the input file is FB or VB.
If it's really VB, then I don't see how you managed to get that OUTREC parameter to work. |
Frank The output file is a FB file and hence the 1-4 bytes havent been included.. |
|
| Back to top |
|
 |
rajandhla
Active User
.jpg)
Joined: 18 Oct 2005 Posts: 182 Location: Luton UK
|
|
|
|
Hi,
Iam using VSAM file for my input which has got min length as80 bytes and maximun of around 900 bytes.
when i use that file has input file at dd name sortin it taking as fixed length file insted if treating variable length file. any specific reason reason to treat as FB. If i included 4 bytes to length iam zero records i.e treating as variable, if i treat as fixed len file iam getting 5lac records.
the following control stmts are for fixed len file:
find below my control card used for sort. and the spool messages
OUTREC FIELDS=(18X,15,4,19,3,22,1,23,2)
SORT FIELDS=COPY
INCLUDE COND=(((23,2,PD,EQ,300,AND,19,3,PD,GE,50041),AND,
(23,2,PD,EQ,300,AND,19,3,PD,LE,51219)),OR,
((23,2,PD,EQ,300,AND,1,3,PD,GE,50041),AND,
(23,2,PD,EQ,300,AND,19,3,PD,LE,50041)))
spool messages:
12K BYTES OF EMERGENCY SPACE ALLOCATED
SORTIN : RECFM=F ; LRECL= 1000; CISIZE = 16384
OUTREC RECORD LENGTH = 28
SORTOUT : RECFM=FB ; LRECL= 28; BLKSIZE= 27972
please let me know the reason
thanks in advance,
jai |
|
| Back to top |
|
 |
rajandhla
Active User
.jpg)
Joined: 18 Oct 2005 Posts: 182 Location: Luton UK
|
|
|
|
I am exepcting the reason is because of the sort treats as
V if SORTIN is VSAM and SORTOUT is VSAM; otherwise F.
correct me if iam wrong,
regards
jai |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Jai,
The messages you show indicate you're using Syncsort, not DFSORT, so I can't help you. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|