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

Strip out the records in a VB file with rec length 4600


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

New User


Joined: 11 Dec 2007
Posts: 82
Location: hyderabad

PostPosted: Sat May 23, 2009 12:41 pm
Reply with quote

Hi All

I have a requirement as below, i have achieved with PLI, But wanted to know if it can be possible with a SORT

My file is a VB file with rec length 4600
Its having records as below

XXXXXXXXXX123456781YYYYYYYYYYYY
XXXXXXXXXX123456781YYYYYYYYYYYY
XXXXXXXXXX123456781YYYYYYYYYYYY
XXXXXXXXXX123456781YYYYYYYYYYYY
XXXXXXXXXX123456782YYYYYYYYYYYY
XXXXXXXXXX123456782YYYYYYYYYYYY
XXXXXXXXXX123456782YYYYYYYYYYYY
XXXXXXXXXX123456782YYYYYYYYYYYY
XXXXXXXXXX123456782YYYYYYYYYYYY
XXXXXXXXXX123456783YYYYYYYYYYYY
XXXXXXXXXX123456783YYYYYYYYYYYY
XXXXXXXXXX123456783YYYYYYYYYYYY
XXXXXXXXXX123456783YYYYYYYYYYYY
XXXXXXXXXX123456784YYYYYYYYYYYY
XXXXXXXXXX123456784YYYYYYYYYYYY
XXXXXXXXXX123456784YYYYYYYYYYYY
XXXXXXXXXX123456784YYYYYYYYYYYY
XXXXXXXXXX123456785YYYYYYYYYYYY
XXXXXXXXXX123456785YYYYYYYYYYYY
XXXXXXXXXX123456785YYYYYYYYYYYY
XXXXXXXXXX123456785YYYYYYYYYYYY
XXXXXXXXXX123456786YYYYYYYYYYYY
XXXXXXXXXX123456786YYYYYYYYYYYY
XXXXXXXXXX123456787YYYYYYYYYYYY
XXXXXXXXXX123456787YYYYYYYYYYYY
XXXXXXXXXX123456789YYYYYYYYYYYY
XXXXXXXXXX123456789YYYYYYYYYYYY

Key starts at 11th position, like this i have lakhs of records. the field in 11th position is an account number. each account have couple of records

I have to strip out the records of accounts depending on a PARM, if i pass 1, it has to strip out first 500 accounts records(observe its not first 500 records). if i pass 2 it needs to give me records of 500 accounts from 501th account, if i pass 3 it needs to give me records of 500 accounts from 1001..like this 1 to 10
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sat May 23, 2009 12:54 pm
Reply with quote

The OP has SyncSort and NOT DFSORT. I think this topic needs to be moved to JCL forum.
Back to top
View user's profile Send private message
Mazahar

New User


Joined: 11 Dec 2007
Posts: 82
Location: hyderabad

PostPosted: Sat May 23, 2009 4:46 pm
Reply with quote

Arun,

ICETOOl also will do

Any ways where ever it can be moved no issues, need solution please.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sat May 23, 2009 5:29 pm
Reply with quote

Mazahar,

You need to have a clear understanding of these facts.

1. Since you have SyncSort, you dont have DFSORT's ICETOOL. You only have Syncsort's SYNCTOOL. You'll be able to execute jobs with PGM=ICETOOL, but that does NOT mean that you have ICETOOL. SyncSort has made "ICETOOL" as an alias name to their product "SYNCTOOL".

2. DFSORT solutions might not work always for a SyncSort shop and vice versa. Hence you should be asking for a solution which works on the product you have.
Back to top
View user's profile Send private message
Mazahar

New User


Joined: 11 Dec 2007
Posts: 82
Location: hyderabad

PostPosted: Sat May 23, 2009 5:46 pm
Reply with quote

Arun,

Thanks for the clear explanation.

Please let me know if you have solution for my question.
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: Sat May 23, 2009 11:39 pm
Reply with quote

Hello,

This topic was moved to the proper part of the forum.

There was no need to post it again.

The duplicate has been removed.

d
Back to top
View user's profile Send private message
Mazahar

New User


Joined: 11 Dec 2007
Posts: 82
Location: hyderabad

PostPosted: Sat May 23, 2009 11:44 pm
Reply with quote

thanx dick

Can any one help me out?
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: Sat May 23, 2009 11:59 pm
Reply with quote

Hello,

Quote:
Can any one help me out?
If anyone even tries before you post better info, they will only be guessing. They might get lucky, but it would only be a guess. . .

Quote:
if i pass 1, it has to strip out first 500 accounts records(observe its not first 500 records).
What does this mean icon_confused.gif

Forget 500 and use 5 for demonstration. Post some (at least 2) sets of input, parms to go with that input, and the exact output (again, only 5) you want from that set of input.

Then, maybe someone could offer a proper suggestion. Guesses should not be posted until you have provided the info.
Back to top
View user's profile Send private message
Mazahar

New User


Joined: 11 Dec 2007
Posts: 82
Location: hyderabad

PostPosted: Sun May 24, 2009 9:55 am
Reply with quote

Dick,

Let us say This is my input file

XXXXXXXXXX123456781YYYYYYYYYYYY
XXXXXXXXXX123456781YYYYYYYYYYYY
XXXXXXXXXX123456781YYYYYYYYYYYY
XXXXXXXXXX123456781YYYYYYYYYYYY
XXXXXXXXXX123456782YYYYYYYYYYYY
XXXXXXXXXX123456782YYYYYYYYYYYY
XXXXXXXXXX123456782YYYYYYYYYYYY
XXXXXXXXXX123456782YYYYYYYYYYYY
XXXXXXXXXX123456782YYYYYYYYYYYY
XXXXXXXXXX123456783YYYYYYYYYYYY
XXXXXXXXXX123456783YYYYYYYYYYYY
XXXXXXXXXX123456783YYYYYYYYYYYY
XXXXXXXXXX123456783YYYYYYYYYYYY
XXXXXXXXXX123456784YYYYYYYYYYYY
XXXXXXXXXX123456784YYYYYYYYYYYY
XXXXXXXXXX123456784YYYYYYYYYYYY
XXXXXXXXXX123456784YYYYYYYYYYYY
XXXXXXXXXX123456785YYYYYYYYYYYY
XXXXXXXXXX123456785YYYYYYYYYYYY
XXXXXXXXXX123456785YYYYYYYYYYYY
XXXXXXXXXX123456785YYYYYYYYYYYY
XXXXXXXXXX123456786YYYYYYYYYYYY
XXXXXXXXXX123456786YYYYYYYYYYYY
XXXXXXXXXX123456787YYYYYYYYYYYY
XXXXXXXXXX123456787YYYYYYYYYYYY
XXXXXXXXXX123456788YYYYYYYYYYYY
XXXXXXXXXX123456789YYYYYYYYYYYY
XXXXXXXXXX123456789YYYYYYYYYYYY
XXXXXXXXXX123456790YYYYYYYYYYYY
XXXXXXXXXX123456790YYYYYYYYYYYY

if i pass 1 as Parm it should give me first 5 accounts records

XXXXXXXXXX123456781YYYYYYYYYYYY
XXXXXXXXXX123456781YYYYYYYYYYYY
XXXXXXXXXX123456781YYYYYYYYYYYY
XXXXXXXXXX123456781YYYYYYYYYYYY
XXXXXXXXXX123456782YYYYYYYYYYYY
XXXXXXXXXX123456782YYYYYYYYYYYY
XXXXXXXXXX123456782YYYYYYYYYYYY
XXXXXXXXXX123456782YYYYYYYYYYYY
XXXXXXXXXX123456782YYYYYYYYYYYY
XXXXXXXXXX123456783YYYYYYYYYYYY
XXXXXXXXXX123456783YYYYYYYYYYYY
XXXXXXXXXX123456783YYYYYYYYYYYY
XXXXXXXXXX123456783YYYYYYYYYYYY
XXXXXXXXXX123456784YYYYYYYYYYYY
XXXXXXXXXX123456784YYYYYYYYYYYY
XXXXXXXXXX123456784YYYYYYYYYYYY
XXXXXXXXXX123456784YYYYYYYYYYYY
XXXXXXXXXX123456785YYYYYYYYYYYY
XXXXXXXXXX123456785YYYYYYYYYYYY
XXXXXXXXXX123456785YYYYYYYYYYYY
XXXXXXXXXX123456785YYYYYYYYYYYY

If i pass 2 as Parm it should give me next 5 accounts records

XXXXXXXXXX123456786YYYYYYYYYYYY
XXXXXXXXXX123456786YYYYYYYYYYYY
XXXXXXXXXX123456787YYYYYYYYYYYY
XXXXXXXXXX123456787YYYYYYYYYYYY
XXXXXXXXXX123456788YYYYYYYYYYYY
XXXXXXXXXX123456789YYYYYYYYYYYY
XXXXXXXXXX123456789YYYYYYYYYYYY
XXXXXXXXXX123456790YYYYYYYYYYYY
XXXXXXXXXX123456790YYYYYYYYYYYY

If i pass 3 as parm is should give next 5 accounts records.
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: Sun May 24, 2009 10:04 am
Reply with quote

Hello Mazhar,

Better icon_smile.gif

What should happen if the 500th record is not the last record for that set? What should happen if an account has 1200 records? Is there a fixed limit to the number of output files that may be written or is there a fixed number of output files and the process must balance all of the data across the limited number of output files?
Back to top
View user's profile Send private message
Mazahar

New User


Joined: 11 Dec 2007
Posts: 82
Location: hyderabad

PostPosted: Sun May 24, 2009 1:10 pm
Reply with quote

Dick,

Good question :-)

If there are 1200 accounts(not records) if i give 1 it should give me 500....if i give 2 it should give me 501 to 1000, if i give 3 it should give me 1001 to 1200....

set should be 500 if there are accounts, if not...it should give what ever available number.
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: Mon May 25, 2009 5:01 am
Reply with quote

Hello,

Quote:
What should happen if an account has 1200 records?
My bad - i believe i got turned sideways. . .icon_redface.gif

So, if i'm now back on track, the first 500 accounts (regardless of record count) should be copied to the output when the parm is a 1. And would continue as you said
Quote:
.if i give 2 it should give me 501 to 1000, if i give 3 it should give me 1001 to 1200....


Apologies for the confusion. . .

Now, if one of our "Sync sort-grammers" has a suggestion. . .

Which release of Syncsort is in use on your system? The release is shown on the informational output from the sort.
Back to top
View user's profile Send private message
Mazahar

New User


Joined: 11 Dec 2007
Posts: 82
Location: hyderabad

PostPosted: Mon May 25, 2009 12:38 pm
Reply with quote

Dick,

How does it relates to my question?
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon May 25, 2009 7:44 pm
Reply with quote

Mazhar,

Consider this: One of the SORT experts spends a goodly amt of time devising a solution to your problem. You try it and your SORT util gives you an error.

The expert says his solution uses the most recent version of the SORT product. You say: "Oh, sorry, I'm using an earlier version".

How does that relate?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Jun 01, 2009 6:48 pm
Reply with quote

Mazahar,

Did you get your problem resolved ?
Back to top
View user's profile Send private message
Mazahar

New User


Joined: 11 Dec 2007
Posts: 82
Location: hyderabad

PostPosted: Mon Jun 01, 2009 10:02 pm
Reply with quote

Arun,

I have already did it with a PLI, Just wanted to know if we can do this with a sort...........but no luck.....
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Jun 01, 2009 10:58 pm
Reply with quote

Quote:
Just wanted to know if we can do this with a sort...........but no luck.....

Hello,

What's your SyncSort version? You might be knowing it, but others can only guess. And the solution IS dependent on which version is installed at your shop.
Back to top
View user's profile Send private message
Mazahar

New User


Joined: 11 Dec 2007
Posts: 82
Location: hyderabad

PostPosted: Thu Jun 11, 2009 8:00 pm
Reply with quote

Arun,

sorry for the delay....i was busy with something else these days.

Quote:
And the solution IS dependent on which version is installed at your shop.


its Syncsort for Z/os 1.3.2.0
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Jun 17, 2009 9:02 pm
Reply with quote

Mazahar,
Quote:
sorry for the delay....i was busy with something else these days
No problem. I was away for a few days and couldnt check this. I am running an older SyncSort version. I can show you an untested example which extracts 5 accounts starting from n-th account where 'n' is passed as input in STEP1.

Code:
//STEP1  EXEC  PGM=SORT                                             
//SYSOUT   DD  SYSOUT=*                                             
//SORTIN   DD *                                                     
2                                                                   
//SORTOUT  DD DSN=&&S1,DISP=(,PASS)                                 
//SYSIN    DD  *                                                     
  SORT FIELDS=COPY                                                   
  OUTREC BUILD=(C'  INCLUDE=(13,8,ZD,LE,',1,1,UFF,MUL,+5,M11,       
                C',AND,13,8,ZD,GE,',(1,1,UFF,MUL,+5),SUB,+4,M11,C')',
                80:X)                                               
/*                                                                   
//STEP2  EXEC  PGM=SORT
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD DSN=Input file  --> VB/4600                                     
//SORTOUT  DD DSN=Output file --> VB/4600                                     
//SYSIN    DD  *                                                 
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,SEQNUM,8,ZD,RESTART=(15,9),8X,21:5)),
  IFTHEN=(WHEN=GROUP,BEGIN=(5,8,ZD,EQ,1),PUSH=(13:ID=8))         
  SORT FIELDS=COPY                                               
  OUTFIL BUILD=(1,4,5:21),                                           
//         DD DSN=&&S1,DISP=(OLD,PASS)
/*
Back to top
View user's profile Send private message
r2k1984

New User


Joined: 21 Jun 2005
Posts: 69
Location: chennai

PostPosted: Fri Jun 19, 2009 4:31 pm
Reply with quote

hey,

you can build a sortcard in a file in first step which should look like the below.

SORT FIELDS=COPY
OUTFIL FILES=01,STARTREC=starting number,ENDREC=ending number

in the next step execute the sort step to get the data.

it will work fine..
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 Jun 19, 2009 8:37 pm
Reply with quote

Hello,

Quote:
SORT FIELDS=COPY
OUTFIL FILES=01,STARTREC=starting number,ENDREC=ending number
How does this even remotely relate to the requirement. . .?

Not only will it not "work fine", it will not work at all for the request.

Please test code that you post and make sure the code to be posted actually does what the requestor asked for - which care must be taken to understand the requirement.
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top