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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: I want to copy the first two fields from a VB file to a FB
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

Site Director


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

PostPosted: Sun Aug 29, 2010 6:19 am    Post subject:
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: 578
Location: USA

PostPosted: Mon Aug 30, 2010 7:17 am    Post subject:
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 Moderator


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

PostPosted: Mon Aug 30, 2010 11:18 pm    Post subject:
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: 578
Location: USA

PostPosted: Mon Aug 30, 2010 11:52 pm    Post subject:
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 Moderator


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

PostPosted: Tue Aug 31, 2010 12:49 am    Post subject:
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    Post subject:
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: 578
Location: USA

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

Frank/Ronald,

Thanks for feedback.

Thanks,
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Aug 31, 2010 2:36 am    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Aug 31, 2010 3:09 am    Post subject:
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

Senior Member


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

PostPosted: Tue Aug 31, 2010 10:47 am    Post subject:
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 Moderator


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

PostPosted: Tue Aug 31, 2010 9:54 pm    Post subject:
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

Senior Member


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

PostPosted: Wed Sep 01, 2010 2:14 am    Post subject:
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    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 syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 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 How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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