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
 

 

Random selection of output data

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Michael Simpson

New User


Joined: 27 Sep 2012
Posts: 6
Location: Sweden

PostPosted: Thu Oct 04, 2012 12:43 pm    Post subject: Random selection of output data
Reply with quote

First of all, let me confess that I have never written any ICETOOL JCL (but am willing to learn).

Could someone point me in the right direction (or tell me it can't be done so I don't waste time).

I have an input file of about 900,000 records. I would like to be able to extract a random number of records from this file based on the following criteria:-

- start/end records should be included (these are identified by specific values in cols 1-2 and are obviously at the start and end of the file)
- selection should be done for a specific value in a specific column for all records other that the start/end records
- a specific randomized number of records from item 2 should be selected after which the JCL should "stop" (apart from then reading to the end so as to include the end record)

Is this easily doable or should I go with an easytrieve program instead (or even a tailor-written Cobol program)
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Thu Oct 04, 2012 3:35 pm    Post subject: Reply to: Rnadom selection of output data
Reply with quote

There are no DFSort functions for selection of random data.

There is a SAMPLE function, but I don't think it does random sampling.

You might consider a E15/35 "exit", but it would probably be "over the top" for the task.

From Easytrieve Plus you'd likely have to use a callable Language Environment routine to get something "random" to work with.

Cobol has an intrinsic function.
Back to top
View user's profile Send private message
Michael Simpson

New User


Joined: 27 Sep 2012
Posts: 6
Location: Sweden

PostPosted: Thu Oct 04, 2012 4:08 pm    Post subject: Reply to: Random selection of output data
Reply with quote

Thanks Bill for the speedy reply.

Tailor-made it'll have to be then.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Thu Oct 04, 2012 8:03 pm    Post subject:
Reply with quote

Michael Simpson,
While you work on tailor-made solution, could you please post sample records and expected output. Also post your actual LRECL and DFSort function level.

Thanks,
Back to top
View user's profile Send private message
Michael Simpson

New User


Joined: 27 Sep 2012
Posts: 6
Location: Sweden

PostPosted: Thu Oct 04, 2012 8:07 pm    Post subject: The function level
Reply with quote

was
Quote:

ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1


As to sample records, I'll have to get back to you on that - have none at the moment
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Oct 05, 2012 12:45 am    Post subject: Re: Random selection of output data
Reply with quote

Michael Simpson wrote:
First of all, let me confess that I have never written any ICETOOL JCL (but am willing to learn).

Could someone point me in the right direction (or tell me it can't be done so I don't waste time).

I have an input file of about 900,000 records. I would like to be able to extract a random number of records from this file based on the following criteria:-

- start/end records should be included (these are identified by specific values in cols 1-2 and are obviously at the start and end of the file)
- selection should be done for a specific value in a specific column for all records other that the start/end records
- a specific randomized number of records from item 2 should be selected after which the JCL should "stop" (apart from then reading to the end so as to include the end record)

Is this easily doable or should I go with an easytrieve program instead (or even a tailor-written Cobol program)


DFSORT does not have Random function generator. If the columns are you want to pick are numeric, then you can use Date/Time stamps as random generation key and pull only such records.

Ex: current time is 12:11:35 you can pass parms to add/subtract/mul/div a constant(which can be modified from each run) via JPn construct and pick the records.

If it is a column data , then you can use IEBDG utility to generate ripple character data and use that to pick records using Joinkeys.

Let us know if the above techniques are acceptable and we can show you a way to extract records.
Back to top
View user's profile Send private message
Michael Simpson

New User


Joined: 27 Sep 2012
Posts: 6
Location: Sweden

PostPosted: Fri Oct 05, 2012 12:58 pm    Post subject: Thank you Kolusu
Reply with quote

Quote:
If it is a column data , then you can use IEBDG utility to generate ripple character data and use that to pick records using Joinkeys.


Sorry - never heard the expression ripple character data - no idea what it means.

Be that as it may .... I basically would like to be able to select a number of records based on, say, the value 888888888888 in columns 13-28.

If it makes the logic easier, I could easily extract the end record, place it in a separate file so it could be appended to the 900,000 file rather than reading the latter all the way through to the end.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Fri Oct 05, 2012 3:01 pm    Post subject: Re: Thank you Kolusu
Reply with quote

Michael Simpson wrote:
Sorry - never heard the expression ripple character data - no idea what it means.

If you have a six-byte field containing "ABCDEF" and ripple it once, the field will then contain either "BCDEFA" or "BCDEFG", depending on the exact definition of the field.

SFAIK, it's a term used only in regards to IEBDG, which sees very little use these days (although it's come up several times recently on this and our sister site).
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Fri Oct 05, 2012 7:37 pm    Post subject:
Reply with quote

Michael Simpson,
Quote:
Be that as it may .... I basically would like to be able to select a number of records based on, say, the value 888888888888 in columns 13-28.

If it makes the logic easier, I could easily extract the end record, place it in a separate file so it could be appended to the 900,000 file rather than reading the latter all the way through to the end.

Sample Data??

If you know the number of records you want to select whenever you have a record with 888888888888 at 13-28, you can use GROUP function to add sequence number and later extract records based on that seq. number. If you know when the record selection ends (for example, 999999999999 on the same position or some other char. at a different position), you can use GROUP BEGIN and END.

Thanks,
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1713
Location: UK

PostPosted: Fri Oct 05, 2012 8:00 pm    Post subject:
Reply with quote

Or perhaps you can generate your random number somewhere else and generate your sort cards using the random number to STOPAFT. You would then have to get your trailer in by whatever other means that you had in mind.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Oct 05, 2012 9:21 pm    Post subject: Re: Thank you Kolusu
Reply with quote

Michael Simpson wrote:
Quote:
If it is a column data , then you can use IEBDG utility to generate ripple character data and use that to pick records using Joinkeys.


Sorry - never heard the expression ripple character data - no idea what it means.

Be that as it may .... I basically would like to be able to select a number of records based on, say, the value 888888888888 in columns 13-28.

If it makes the logic easier, I could easily extract the end record, place it in a separate file so it could be appended to the 900,000 file rather than reading the latter all the way through to the end.


Michael Simpson,

Check this link which explains IEBDG (Test Data Generator) Program

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DGT2U170/4.0?
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 0 Tue Dec 06, 2016 4:38 am
No new posts How to move a long alphanumeric data ... lind sh COBOL Programming 5 Mon Dec 05, 2016 7:51 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm


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