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

DFSORT of VB file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rohitpb

New User


Joined: 04 Jan 2006
Posts: 5

PostPosted: Fri Feb 10, 2006 3:37 pm
Reply with quote

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
View user's profile Send private message
prabs2006

Active User


Joined: 12 Jan 2006
Posts: 103

PostPosted: Fri Feb 10, 2006 4:48 pm
Reply with quote

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
View user's profile Send private message
prabs2006

Active User


Joined: 12 Jan 2006
Posts: 103

PostPosted: Fri Feb 10, 2006 4:50 pm
Reply with quote

Hi,

On the second thought I wanted you to check with 04 rather than 004.

T & R
Prabs
Back to top
View user's profile Send private message
rohitpb

New User


Joined: 04 Jan 2006
Posts: 5

PostPosted: Fri Feb 10, 2006 7:18 pm
Reply with quote

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
View user's profile Send private message
pkmainframe

New User


Joined: 14 Jun 2005
Posts: 16
Location: India

PostPosted: Fri Feb 10, 2006 7:57 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Fri Feb 10, 2006 9:16 pm
Reply with quote

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
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Fri Feb 10, 2006 10:31 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Fri Feb 10, 2006 10:48 pm
Reply with quote

jai,

In the future, please start a new thread for a different topic rather than adding it to an unrelated topic.

If the record lengths can vary from 87 to 1000 bytes, then you should treat the VSAM data set as variable. For more information on using VSAM data sets with DFSORT, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA10/1.8.3.4?SHELF=&DT=20050222160456&CASE=
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Fri Feb 10, 2006 11:46 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Sat Feb 11, 2006 1:28 am
Reply with quote

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
View user's profile Send private message
rohitpb

New User


Joined: 04 Jan 2006
Posts: 5

PostPosted: Mon Feb 13, 2006 12:01 pm
Reply with quote

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
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Thu Feb 16, 2006 3:56 pm
Reply with quote

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
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Thu Feb 16, 2006 5:13 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu Feb 16, 2006 9:15 pm
Reply with quote

Jai,

The messages you show indicate you're using Syncsort, not DFSORT, so I can't help you.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 4
No new posts Date format correction using dfsort DFSORT/ICETOOL 3
No new posts how to eliminate null indicator value... DB2 7
No new posts Format Binary file to EBCDIC JCL & VSAM 4
No new posts DFSORT GUID DFSORT/ICETOOL 5
Search our Forums:

Back to Top