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

sort out records that before and after specfied record


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

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Tue Sep 02, 2008 8:50 pm
Reply with quote

Hi,

My requirment is to sort out separately N records that before and after a specified record(the specified record also included.)

for example. i have a dataset named AAA.BBB.CCC,

and data in it are like this

Input

Code:

1
2
3
4
5
6
7


when N=1 and the specified record is 4

output should be

Code:

3
4
5

I hope i have described my requirement clearly... if any question, please let me know... thanks
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: Tue Sep 02, 2008 9:35 pm
Reply with quote

Are the records really numbered like that and is the record to be selected indicated by a number? Or is it more complicated than that? If so, then please give a more accurate description of the input records (real values) and how you identify the specified record (real value or relative record number or ?).

Also, where are N=1 and 4 found - are they values you will hardcode, or in a file, or what?

Are you only looking for one set of records (e.g. 3-5, or are you really looking for multiple sets of records (e.g. 3-5, 9-11 and 21-23)?
Back to top
View user's profile Send private message
quanzhong

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Wed Sep 03, 2008 7:17 am
Reply with quote

Hi, Frank

The records are more complicated than that mentioned above.. actually, the file contains much account information. and the using account number as the Key(S(19))..

my aim is. according to the given account number, to sort out records before and after that account... because the file contains more 1 million records, and record length is more than 60,000 byte. I hope this helps...
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: Wed Sep 03, 2008 8:47 pm
Reply with quote

You still haven't described what you're trying to do in enough detail for me to help you. You didn't answer my question about whether you're looking for one set of records or multiple sets of records, or how you specify the needed information about the target account and "spread". It isn't clear if you want to extract the records before or after they are sorted (or even if you want them sorted).

Quote:
record length is more than 60,000 byte


Huh? DFSORT cannot handle files with records that big. What type of file is it? What are its attributes (RECFM? LRECL?).
Back to top
View user's profile Send private message
quanzhong

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Thu Sep 04, 2008 10:27 am
Reply with quote

Hi, Frank
Quote:

Are you only looking for one set of records (e.g. 3-5, or are you really looking for multiple sets of records (e.g. 3-5, 9-11 and 21-23)?

I just looking for one set of records at one time.
Code:

It isn't clear if you want to extract the records before or after they are sorted (or even if you want them sorted).

This file is KSDS, account number(1:19) as the key value..
Quote:

DFSORT cannot handle files with records that big. What type of file is it? What are its attributes (RECFM? LRECL?).

Made a type error.. the RECFM is FB, and LRECL=6549,not more than 60,000 as i typed before.. thanks...
as discussed, I am just looking for a set of records.
hope clear now...
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 Sep 04, 2008 10:03 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. It will work fine unless you don't have the number of records specified before the target record (for example, if you ask for record 2 with N=+2) - that could be fixed, but I didn't bother at this point since I don't know if you will ever have that situation.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG   DD  SYSOUT=*
//SYMNAMES DD *
* Specify target account number as string
TARGACCT,'1234567890123456789'
* Specify number of records before and after as +d (+ is required)
N,+1
/*
//IN DD DSN=...  input file (FB)
//CTL2CNTL DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB)
//TOOLIN   DD    *
COPY FROM(IN) TO(CTL2CNTL) USING(CTL1)
COPY FROM(IN) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(20:SEQNUM,8,ZD)
  OUTFIL FNAMES=CTL2CNTL,
    INCLUDE=(1,19,CH,EQ,TARGACCT),
    BUILD=(C'  OPTION SKIPREC=',
      20,8,ZD,SUB,N,SUB,+1,TO=ZD,LENGTH=8,
      C',STOPAFT=',N,ADD,N,ADD,+1,TO=ZD,LENGTH=8,80:X)
/*
Back to top
View user's profile Send private message
quanzhong

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Fri Sep 05, 2008 10:02 am
Reply with quote

Hi, frank

thanks for your help.. i am so glad you finally got my requirement..
I'll try as you described. and tell you result.
Back to top
View user's profile Send private message
quanzhong

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Fri Sep 12, 2008 9:36 am
Reply with quote

Hi, franker

I modified you job for my aim,
Code:

//STEP0200 EXEC  PGM=ICETOOL                                     
//TOOLMSG  DD  SYSOUT=*                                           
//DFSMSG   DD  SYSOUT=*                                           
//SYMNAMES DD *                                                   
* SPECIFY TARGET ACCOUNT NUMBER AS STRING                         
TARGACCT,'1000004357440004379003'                                 
* SPECIFY NUMBER OF RECORDS BEFORE AND AFTER AS +D (+ IS REQUIRED)
N,+1                                                             
/*                                                               
//IN       DD DSN=DCNVPH1.SDB.CMS.AMBS.S1.KE,DISP=SHR             
//CTL2CNTL DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS) 
//OUT       DD DSN=DCNVPH1.SDB.CMS.AMBS.SORTCD5,                 
//             DISP=(NEW,CATLG,DELETE),                           
//             UNIT=3390,                                         
//             SPACE=(TRK,(10,10),RLSE)                           
//TOOLIN   DD    *                                               
COPY FROM(IN) TO(CTL2CNTL) USING(CTL1)                           
COPY FROM(IN) TO(OUT) USING(CTL2)                                 
/*                                                               
//CTL1CNTL DD *                                                   
  INREC OVERLAY=(6550:SEQNUM,8,ZD)                               
  OUTFIL FNAMES=CTL2CNTL,                                         
    INCLUDE=(1,22,CH,EQ,TARGACCT),                               
    BUILD=(C'  OPTION SKIPREC=',                                 
        6550,8,ZD,SUB,N,SUB,+1,TO=ZD,LENGTH=8,                   
        C',STOPAFT=',N,ADD,N,ADD,+1,TO=ZD,LENGTH=8,6560:X)       
/*                                                               

and got U016 abend code, output message is
Quote:

CTL2CNTL :
OPTION SKIPREC=0000001G,STOPAFT=0000000C
DATA DICTIONARY SYMBOLS SUBSTITUTED :
OPTION SKIPREC=0000001G,STOPAFT=0000000C
*
PARMLIST :
OPTION RESINV=0,ARESINV=0,MSGDDN=DFSMSG,SORTIN=IN,SORTOUT=OUT,SORTDD=CTL2,COPY
WER428I CALLER-PROVIDED IDENTIFIER IS "0002"
WER268A OPTION STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000

can you tell me how can i avoid this.. very appreciated..
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Sep 12, 2008 11:25 am
Reply with quote

Hi,

I don't think this is going to please Frank since you are using SYNCSORT which is the competitor to DFSORT.


Gerry
Back to top
View user's profile Send private message
quanzhong

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Fri Sep 12, 2008 12:46 pm
Reply with quote

Hi, gcicchet
Quote:

I don't think this is going to please Frank since you are using SYNCSORT which is the competitor to DFSORT


Choose DFSORT or SYNCSORT? it's not decided by me. actually, i have no idea what's difference between them.. seems to me, there's no syntax difference between them...
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Sep 12, 2008 1:18 pm
Reply with quote

Hi,

WER messages belong to SYNCSORT
ICE messages belong to DFSORT

As they are in opposition they try to provide the same functionalities.

Surely you dont expect a person working for a particular company who's trying to flog their product assisting you with someone using their competitor's product.


Gerry
Back to top
View user's profile Send private message
quanzhong

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Fri Sep 12, 2008 1:25 pm
Reply with quote

Hi
Quote:

Surely you dont expect a person working for a particular company who's trying to flog their product assisting you with someone using their competitor's product.

Maybe one day, i wil lbe working for another company using DFSORT. however, thanks all. actually, every one here is very kind, and i like this forum very much..
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Sep 12, 2008 1:41 pm
Reply with quote

Hi,

I'm sure someone with SYNCSORT experience wiil assist with your problem.

This thread will need to be moved from the DFSORT forum.


Gerry
Back to top
View user's profile Send private message
quanzhong

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Fri Sep 12, 2008 1:58 pm
Reply with quote

Hi, gcicchet

thanks very much. I have found the solution.. also many thanks to frank..
I think it's not suitable to post the solution here... so sorry for SYNCSORT fans.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Sep 12, 2008 2:03 pm
Reply with quote

Quanz,

Quote:
I think it's not suitable to post the solution here


You can very well post the SYNCSORT solution as the topic has already been moved out of the DFSORT forum .

Fine, If you are not posting for any other reason.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Sep 12, 2008 8:59 pm
Reply with quote

Hello,

Quote:
I think it's not suitable to post the solution here...
Why would you believe your Syncsort solution not suitable for posting here?

Possibly there is something i misunderstand icon_confused.gif
Back to top
View user's profile Send private message
quanzhong

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Sat Sep 13, 2008 8:47 pm
Reply with quote

Hi, Aaru,

just change TO=ZD to TO=ZDF。 nothing special..

thanks
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top