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
 
Sort extract - KSDS VSAM File - error - need help

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

Active User


Joined: 04 Oct 2006
Posts: 118
Location: NJ, USA

PostPosted: Thu Dec 28, 2006 9:08 pm    Post subject: Sort extract - KSDS VSAM File - error - need help
Reply with quote

Hi,
I have a KSDS vsam file. I need to extract records which has a 'Y' on the particular position. I tried giving the condition in the sort card, but not getting the desired result.

I am not sure how to paste the contents from the mainframe screen like everyone..Attached all the deatils in the document.

Viji
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Dec 28, 2006 9:16 pm    Post subject:
Reply with quote

I'm thinking that sort might be treating it a variable, try adding 4 to the displacement....
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Thu Dec 28, 2006 9:34 pm    Post subject: Re: Sort extract - KSDS VSAM File - error - need help
Reply with quote

I'm extremely leery of opening foreign Microsoft documents (Word or Excel).

vijikesavan wrote:
I am not sure how to paste the contents from the mainframe screen like everyone.


You use standard Windows cut/paste from your emulator to your desktop. For data and code, in order to make it easy to read and to keep spaces and indentation intact, you use the bbI CODE tags around the data:

[ code ]
my data ...
[ /code ]

Just don't include the spaces as shown.

Using your VSAM definition, data, and SORT JCL, it worked just fine for me. Can you post the output from your SYSOUT DD?
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: Thu Dec 28, 2006 11:15 pm    Post subject:
Reply with quote

Viji,

Since you didn't use a RECORD TYPE=x statement to tell DFSORT whether to treat your VSAM input file as F or V, DFSORT used the default of V based on the fact that your input and output files are VSAM. For V processing, DFSORT adds a 4-byte RDW to each record, so the first data byte starts at 5, not 1. Therefore, you have to use position 12 (8+4) for your 'Y' field rather than positon 8. I'd suggest using RECORD TYPE=V for documentation:

Code:

   OPTION COPY
   RECORD TYPE=V
   INCLUDE COND=(12,1,CH,EQ,C'Y')


For more information on processing VSAM files with DFSORT, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/1.8.3.4?SHELF=&DT=20060615185603&CASE=
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Dec 28, 2006 11:23 pm    Post subject:
Reply with quote

Frank,

I saw the same thing in Syncsort, but for the life of me I couldn't determine that the output file was VSAM, because if not, Syncsort would have used F for the input. How did you figure it?

Bill
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: Thu Dec 28, 2006 11:43 pm    Post subject:
Reply with quote

William,

I just assumed the SORTOUT file was VSAM since it had 'VSAM' in the dataset name. I guess I could have been wrong, but it fit with the "problem".
Back to top
View user's profile Send private message
vijikesavan

Active User


Joined: 04 Oct 2006
Posts: 118
Location: NJ, USA

PostPosted: Thu Dec 28, 2006 11:44 pm    Post subject: Re: Sort extract - KSDS VSAM File - error - need help
Reply with quote

Hello everyone,
It worked fine when I gave the position as "12" irrespective of record type = V. (Both worked)

Its really amazing to see the replies so fast....thanks a lot for your help.
-Viji
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: Thu Dec 28, 2006 11:46 pm    Post subject:
Reply with quote

Quote:
It worked fine when I gave the position as "12" irrespective of record type = V. (Both worked)


Yes, as I said, DFSORT will use a default type of V in this case. But it's "safer" to specify RECORD TYPE=V explicitly in case something changes (for example, in case you change the output file to non-VSAM some time in the future).
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Dec 28, 2006 11:48 pm    Post subject:
Reply with quote

Frank Yaeger wrote:
I just assumed the SORTOUT file was VSAM since it had 'VSAM' in the dataset name.
icon_redface.gif Jeez, "male vision" again icon_redface.gif
Quote:
I guess I could have been wrong, but it fit with the "problem".
I was leaning that way, almost posted, but just didn't feel sure enough, besides I knew the cavalry was coming..... icon_wink.gif
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts VSAM RLS Wait time blayek JCL & VSAM 2 Mon Oct 02, 2017 9:05 pm

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