Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Strip out the records in a VB file with rec length 4600
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Strip out the records in a VB file with rec length 4600
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: 2171
Location: @my desk

PostPosted: Sat May 23, 2009 12:54 pm    Post subject:
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    Post subject:
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: 2171
Location: @my desk

PostPosted: Sat May 23, 2009 5:29 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Sat May 23, 2009 11:39 pm    Post subject: Reply to: First 500 Keys
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    Post subject:
Reply with quote

thanx dick

Can any one help me out?
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Sat May 23, 2009 11:59 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Sun May 24, 2009 10:04 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon May 25, 2009 5:01 am    Post subject:
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    Post subject:
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    Post subject:
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: 2171
Location: @my desk

PostPosted: Mon Jun 01, 2009 6:48 pm    Post subject:
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    Post subject:
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: 2171
Location: @my desk

PostPosted: Mon Jun 01, 2009 10:58 pm    Post subject:
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    Post subject:
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: 2171
Location: @my desk

PostPosted: Wed Jun 17, 2009 9:02 pm    Post subject:
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    Post subject: Reply to: Strip out the records in a VB file with rec length
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us