|
View previous topic :: View next topic
|
| Author |
Message |
jagadeesharava
New User
Joined: 13 Feb 2008 Posts: 1 Location: banglore
|
|
|
|
Please provide me the sort card for my below mentioned query.
The input file as following fields :
1. Provider ID, 9 bytes, alpha numeric
2. Province, 4 bytes, alpha numeric
3. License number , 9 bytes, numeric
4. Type code, 1 byte, alpha numeric.
This is a VB file.
Introduce a SORT step in the JCL which will format the input file so that the out has only the following fields
1. Provider ID, 9 bytes, alpha numeric
2. Province, 4 bytes, alpha numeric
The output is a FB file and ensure that it only has records where province is populated.
Thanks,
Jagadeesh.  |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
Unless you want to change the order of the records, you can use an OPTION COPY (rather than specifying sort fiels).
You can keep or discard that has a province populated by usine INCLUDE or OMIT (depending on which works better for you.
You can format the new output records using BUILD.
There are many examples of these in the forum (search feature above).
Which sort product is used on your system? Please post the informatonal output from any sort job including the message ids. |
|
| Back to top |
|
 |
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
jagadeesharava,
| Quote: |
| The output is a FB file and ensure that it only has records where province is populated. |
By populated, I am assuming you are trying to check for values greater than SPACES. If this is not what you want, please show us some example.
Please find below jcl to get what you asked for...
| Code: |
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD YOUR VB FILE GOES HERE
//SORTOUT DD YOUR FB FILE GOES HERE
//SYSIN DD *
INREC BUILD=(1,4,5,9,14,4)
OPTION COPY
OUTFIL INCLUDE=(14,4,CH,GT,C' '),BUILD=(5,13),VTOF
/*
|
Thanks, |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
sqlcode1,
You don't need the INREC statement. |
|
| Back to top |
|
 |
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
Frank,
Since OP needed only 2 fields in his output, I used INREC statement to select those 2 fields only.
I thought this was efficient to do so, is it not the case?
Thanks, |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Well, that might or might not be true for a SORT operation (YMMV), but since this is a COPY operation, it turns out not to be true. |
|
| Back to top |
|
 |
Ronald Burr
Active User

Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
In a COPY only operation there is no need to reformat the input record to reduce the amount of data being carried around in intermediate (e.g. SORTWKxx) files. Hence, in this case, not only is the use of INREC not MORE efficient, it is, in fact, LESS efficient, since it requires additional data manipulation.
But, If INREC processing WOULD have made it more efficient ( e.g. if a sort were required and the original input file had an LRECL of 600 ), then, since the three fields (1,4,5,9,14,4) are contiguous, it would have been more efficient to simply state
INREC BUILD=(1,17)
By coding the BUILD with just ONE (contiguous) field instead of three, the work of building the intermediate record would be reduced ( just one move per input record instead of three ).
Note: In a previous thread I asked if DFSORT was coded such that contiguous fields (of the same data type) were automatically consolidated during INREC/OUTREC processing and I was NOT told that it DID include such logic, so I am left to assume that it does NOT include such logic. As always, I welcome correction/enlightenment. |
|
| Back to top |
|
 |
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
Frank/Ronald,
Thanks for feedback.
Thanks, |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
| Note: In a previous thread I asked if DFSORT was coded such that contiguous fields (of the same data type) were automatically consolidated during INREC/OUTREC processing and I was NOT told that it DID include such logic, so I am left to assume that it does NOT include such logic. As always, I welcome correction/enlightenment. |
I don't know which previous thread you're referring to or what was said about what, but ...
Except for the RDW which is treated specially, DFSORT will consolidate contiguous fields. 1,17 and 1,4,5,9,14,4 would be treated the same internally. |
|
| Back to top |
|
 |
Ronald Burr
Active User

Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
Anuj,
Yes, that does help, thank you.
Note: The post you refer to was made well before I joined this site, BUT the fault remains mine for not SEARCHing to see if any post related to consolidation of fields had been made by anyone connected with DFSORT before my arrival here. A valuable lesson, for which I thank you.
I must add, however, that when I raised the same question earlier this month, there was no response either way. That's why I felt it necessary to post the caveat. |
|
| Back to top |
|
 |
Ronald Burr
Active User

Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
| Frank Yaeger wrote: |
| Quote: |
| Note: In a previous thread I asked if DFSORT was coded such that contiguous fields (of the same data type) were automatically consolidated during INREC/OUTREC processing and I was NOT told that it DID include such logic, so I am left to assume that it does NOT include such logic. As always, I welcome correction/enlightenment. |
I don't know which previous thread you're referring to or what was said about what, but ... |
Frank,
The previous thread I was referring to was:
Clarification on Sort Performance, and specifically the post I made on Thu Aug 19, 2010 at 8:46 am, in which I said (emphasis mine):
| Ronald Burr wrote: |
| By combining fields ( i.e. coding 1,39 instead of 1,4,5,4,9,4,13,18,31,9 ) you will reduce the number of data moves required during the refomatting process ( unless the DFSORT developers put in code to test for, and consolidate same ) |
As I said, there was no response either confirming that DFSORT did perform consolidation or did not do so. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
| As I said, there was no response either confirming that DFSORT did perform consolidation or did not do so. |
| Quote: |
| so I am left to assume that it does NOT include such logic. |
When somebody chooses NOT to confirm or deny something, it's not safe to assume the answer is one thing or another.
The complete answer is really more complicated than just "yes" or "no". It depends on the situation. There's lots of code in DFSORT for lots of different situations. The DFSORT code is proprietary and we do not discuss it for the most part. Please don't think that because the DFSORT developers here (Kolusu and myself) can't reveal everything, that you are necessarily correct in assumptions that we don't discuss.
When it comes to performance, it almost always "depends". And all one can give is general guidelines. There will usually be exceptions.
The best advice anyone can give about sort performance questions is try it yourself in your own environment and come to conclusions based on your own criteria. |
|
| Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
| Ronald Burr wrote: |
Anuj,
Yes, that does help, thank you. |
Glad I could be of help, Ronald. However, my post is deleted, so not sure if it really helped you.  |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Anuj,
The thread you referenced was about contiguous SORT fields, whereas Ronald was asking about contiguous INREC fields. So I deleted your post and addressed the question asked. |
|
| Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Not a problem, Frank.
Have a good one, |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|