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

Sort on hex value, while copying from VB to FB


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Superior Member


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

PostPosted: Fri Mar 29, 2013 1:37 pm
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

Superior Member


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

PostPosted: Fri Mar 29, 2013 1:42 pm
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
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

Superior Member


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

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

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Mar 29, 2013 2:13 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top