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

I want to copy the first two fields from a VB file to a FB


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jagadeesharava

New User


Joined: 13 Feb 2008
Posts: 1
Location: banglore

PostPosted: Sun Aug 29, 2010 4:33 am
Reply with quote

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. icon_cool.gif
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 Aug 29, 2010 6:19 am
Reply with quote

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
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Mon Aug 30, 2010 7:17 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Aug 30, 2010 11:18 pm
Reply with quote

sqlcode1,

You don't need the INREC statement.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Mon Aug 30, 2010 11:52 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Aug 31, 2010 12:49 am
Reply with quote

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
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Tue Aug 31, 2010 12:50 am
Reply with quote

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
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Tue Aug 31, 2010 1:06 am
Reply with quote

Frank/Ronald,

Thanks for feedback.

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 Aug 31, 2010 2:36 am
Reply with quote

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
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Tue Aug 31, 2010 2:38 am
Reply with quote

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
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Tue Aug 31, 2010 2:48 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Aug 31, 2010 3:09 am
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Aug 31, 2010 10:47 am
Reply with quote

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. icon_sad.gif
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 Aug 31, 2010 9:54 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Sep 01, 2010 2:14 am
Reply with quote

Not a problem, Frank.

Have a good one,
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
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