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

Sort extract - KSDS VSAM File - error - need help


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 3156
Location: Tucson AZ

PostPosted: Thu Dec 28, 2006 9:16 pm
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

Global Moderator


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

PostPosted: Thu Dec 28, 2006 9:34 pm
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 Developer


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

PostPosted: Thu Dec 28, 2006 11:15 pm
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:

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: 3156
Location: Tucson AZ

PostPosted: Thu Dec 28, 2006 11:23 pm
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 Developer


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

PostPosted: Thu Dec 28, 2006 11:43 pm
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
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 Developer


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

PostPosted: Thu Dec 28, 2006 11:46 pm
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: 3156
Location: Tucson AZ

PostPosted: Thu Dec 28, 2006 11:48 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top