|
View previous topic :: View next topic
|
| Author |
Message |
manigadu
New User

Joined: 29 Aug 2008 Posts: 10 Location: Bangalore
|
|
|
|
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 |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
As far as I can make out of your post, you should change this
to
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 |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
| 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 |
|
 |
manigadu
New User

Joined: 29 Aug 2008 Posts: 10 Location: Bangalore
|
|
|
|
| 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 |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
| Glad you got it working - Thanks for the feedback. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|