Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
vsam to gdg

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
saru

New User


Joined: 17 Feb 2005
Posts: 4

PostPosted: Fri Feb 18, 2005 2:39 pm    Post subject: vsam to gdg
Reply with quote

hai!
can any body send me the solution of the following:

i have a Vsam KSDS file 'FILE1', with 10000 records, each having some fields, one of the field is 'FIELD1' of size 10 bytes.

and now i want to read that ksds file records and search for 'indic' string . (this 'indic' is located in last 5 bytes of the 'FIELD1' variable.)

so if u find that in any record then write that record in to other o/p file(gdg), else write in to empty file.

consider it as urgent
with thanks
saru
Back to top
View user's profile Send private message
References
PostPosted: Fri Feb 18, 2005 2:39 pm    Post subject: Re: vsam to gdg Reply with quote

Frank Yaeger

DFSORT Moderator


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

PostPosted: Fri Feb 18, 2005 10:35 pm    Post subject:
Reply with quote

You can use DFSORT to do this. DFSORT can always process a KSDS as TYPE V. DFSORT can process a KSDS as TYPE F if all of the records are the same length.

Let's assume the string you want to check starts in data position 21.

With TYPE V processing, the starting position would be 25 (21 + 4 for the RDW that DFSORT uses) and you could use this DFSORT job to write only the records with the given string to the output data set:

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...   VSAM input file
//SORTOUT DD DSN=...  VB output file
//SYSIN DD *
   OPTION COPY
   RECORD TYPE=V
   INCLUDE COND=(25,5,CH,EQ,C'indic')


With TYPE F processing, the starting position would be 21 and you could use this DFSORT job to write only the records with the given string to the output data set:

Code:

//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...   VSAM input file
//SORTOUT DD DSN=...  FB output file
//SYSIN DD *
   OPTION COPY
   RECORD TYPE=F
   INCLUDE COND=(21,5,CH,EQ,C'indic')


For more information on processing VSAM data sets with DFSORT, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA10/1.8.3.4?SHELF=&DT=20050120082820&CASE=

I don't know what you mean by "else write in to empty file.". You need to explain what you mean by this if you want more help. Showing an example of your input recoreds and what you expect for output would be a good way to clarify what you need.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1