IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

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

Senior Member


Joined: 22 Apr 2006
Posts: 6251
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

Senior Member


Joined: 22 Apr 2006
Posts: 6251
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

Senior Member


Joined: 22 Apr 2006
Posts: 6251
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: 7312
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 All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts COBOL VS SORT Utility for file format... COBOL Programming 6
No new posts Copying data from prev record using SORT SYNCSORT 19
No new posts Combining more 4 files with sorted or... DFSORT/ICETOOL 3
This topic is locked: you cannot edit posts or make replies. Parsing more than 1000 columns in a s... SYNCSORT 10
This topic is locked: you cannot edit posts or make replies. SORT the records based on the second ... SYNCSORT 1

Back to Top