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
 

 

Sort on hex value, while copying from VB to FB

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

New User


Joined: 29 Aug 2008
Posts: 10
Location: Bangalore

PostPosted: Fri Mar 29, 2013 1:30 pm    Post subject: Sort on hex value, while copying from VB to FB
Reply with quote

I am trying to copy a few records from a VB file to a FB file by including some conditions. In the sort card, I am using this:

Code:
OPTION COPY                                               
OUTFIL FNAMES=SORTOUT,VTOF,INCLUDE((10,3,CH,EQ,C'PHD',OR, 
                    18,3,CH,EQ,C'PHD',OR,                 
                    10,3,CH,EQ,C'PHH',OR,                 
                    18,3,CH,EQ,C'PHH',OR,                 
                    10,3,CH,EQ,C'PHJ'),AND,               
                   (1,1,CH,EQ,X'AD'))                   
But I am not able to see the records that have AD (hex) in the first position of the VB file copied into the FB file. The job runs successfully but its not copying the records that have AD in the first position. Please help.
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


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

PostPosted: Fri Mar 29, 2013 1:37 pm    Post subject:
Reply with quote

As far as I can make out of your post, you should change this
Code:
(1,1,CH,EQ,X'AD'))
to
Code:
(5,1,CH,EQ,X'AD'))


Hopefully, RDW was considered for other sort statements.

PS.: Please learn to use BBcode Tags, I've edited your post to add them.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Fri Mar 29, 2013 1:42 pm    Post subject:
Reply with quote

Though I've edited your post but the original Sort statements were missing "=" after INCLUDE so I did not add that. Hopefully, that's a typo from your side.
Back to top
View user's profile Send private message
manigadu

New User


Joined: 29 Aug 2008
Posts: 10
Location: Bangalore

PostPosted: Fri Mar 29, 2013 1:54 pm    Post subject:
Reply with quote

Thank you Anuj, It worked, and also I understand I have to use 14,3,CH,EQ,C'PHD' instead of 10,3,CH,EQ,C'PHD'. because we have to consider RDW
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Fri Mar 29, 2013 2:06 pm    Post subject:
Reply with quote

Glad you got it working - Thanks for the feedback.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Fri Mar 29, 2013 2:13 pm    Post subject: Re: Sort on hex value, while copying from VB to FB
Reply with quote

I don't know if it is just me, but this I find much easier to read. Not only change the 1 and 10, but the 18 as well.

Code:
OPTION COPY                                               
OUTFIL FNAMES=SORTOUT,
       VTOF,
       INCLUDE=((5,1,CH,EQ,X'AD')
               AND,               
                (14,3,CH,EQ,C'PHD',
                OR, 
                 22,3,CH,EQ,C'PHD',
                OR,                 
                 14,3,CH,EQ,C'PHH',
                OR,                 
                 22,3,CH,EQ,C'PHH',
                OR,                 
                 14,3,CH,EQ,C'PHJ'))                   
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Sat Mar 30, 2013 1:59 am    Post subject: Reply to: Sort on hex value, while copying from VB to FB
Reply with quote

Ideally I would move the INCLUDE cards to the input phase so that you would read less number of records. You also need to provide the position and length when using VTOF. try the following control cards.

Code:

//SYSIN    DD *                                     
  OPTION COPY,VLSCMP                               
  INCLUDE COND=(5,1,CH,EQ,X'AD',AND,               
                (14,3,SS,EQ,C'PHD,PHH,PHJ',OR,     
                 22,3,SS,EQ,C'PHD,PHH'))           
                                                   
  OUTFIL VTOF,BUILD=(5,n)

**  where n = your vb lrecl - 4                         
//*
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 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
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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