How to skip the header when executing a query in batch



IBM's flagship relational database management system

How to skip the header when executing a query in batch

Postby rakeshsneha1212 » Sun Aug 19, 2018 6:51 pm

Hi everyone,

Can someone please help me how to skip the header when executing a SQL query in batch mode and writing it to a dataset. I will be validating the dataset further to check if it is empty or not.

Regards,
Rakesh MS

topic split
rakeshsneha1212
 
Posts: 28
Joined: Thu Mar 30, 2017 2:09 pm
Has thanked: 5 times
Been thanked: 0 time

Re: How to skip the header when executing a query in batch

 

Re: How to skip the header when executing a query in batch

Postby NicC » Mon Aug 20, 2018 4:06 pm

What header?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2823
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 118 times

Re: How to skip the header when executing a query in batch

Postby rakeshsneha1212 » Mon Aug 20, 2018 5:11 pm

Hi Nicc,

I want only the value along with their respective columns to be in the output. I don't want the SQL statements and other generic messages in the output.

Just a sample of my output

1
1PAGE 1
***INPUT STATEMENT:
SELECT A.E058_PO_NBR, A.W001_RR_NBR,
'PO NOT FOUND' AS REMARKS
FROM LOWES.W001_PO_DAL_HDR A
WHERE
((A.E058_PO_NBR = 037532269 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 037532270 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
)
AND NOT EXISTS (
SELECT 1 FROM
LOWES.T7914_IPT_PO_HDR_OTB_EDI_SS T7914
WHERE T7914.PO_RFR_NBR = A.E058_PO_NBR);
+------------------------------------------------+
| E058_PO_NBR | W001_RR_NBR | REMARKS |
+------------------------------------------------+
1_| 37532269 | 1 | PO NOT FOUND |
+------------------------------------------------+
0SUCCESSFUL RETRIEVAL OF 1 ROW(S)


What I need in my output is just as below
+------------------------------------------------+
| E058_PO_NBR | W001_RR_NBR | REMARKS |
+------------------------------------------------+
_| 37532269 | 1 | PO NOT FOUND |
+------------------------------------------------+

Regards,
Rakesh MS
rakeshsneha1212
 
Posts: 28
Joined: Thu Mar 30, 2017 2:09 pm
Has thanked: 5 times
Been thanked: 0 time

Re: How to skip the header when executing a query in batch

Postby NicC » Tue Aug 21, 2018 12:44 am

Please use the code tags when posting data, code, reports or anything else requiring a fixed pitch font.

To get what you want you need to post-process the output to remove the lines that you do not want.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2823
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 118 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post