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
 

 

Selective table Unload resulting in an extra byte file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Sat May 22, 2010 9:32 am    Post subject: Selective table Unload resulting in an extra byte file
Reply with quote

Hi,

I am doing a selective table unload whose output would be a flat file.

In my sql query the first parameter is of 26 bytes, second is also of 26 bytes, third and 4th have values within 30 bytes.


So i have declared the LRECL length of the output file in my Unload JCL as 112 .

The first two fields are timestamp, third is just a constant(literal) and fourth will have the actual value of the field.

I am taking 3 and 4th field as 30 bytes because the same query i will run for other fields also and no field has length more than 30 bytes.

I am writing the query here--

SELECT SAT_VAL, DAT_VAL,
CAST('FA_NUM' AS CHAR(30)), CAST(FA_NUM AS CHAR(30))
FROM ABTDBPT.ACCT_ATTR
WHERE FA_NUM=6789 WITH UR;

FA_NUM IS A NOT NULL FIELD.

After i run this unload JCL, the output file generated shows 113 bytes as the length though i have declared LRECL as 112 in my JCL.

What i see is a low value in the 53rd byte of the output file though it is unexpected and in the SYSPUNCH output file(after the job is executed) in the same JCL, i see in the layout at the 53rd byte it is written 'NULL IF ?'

Please let me know how low value has come in the flat file and why
'NULL IF ?' is embeded in the SYSPUNCH output file though the field is NOT NULL.

I have ran this query in the same format with other NULL and NOT NULL fields but i never saw this change there.

Please help.

Thanks
Back to top
View user's profile Send private message

sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Sat May 22, 2010 8:57 pm    Post subject:
Reply with quote

Meenakshi,

Can you show us your JCL, it worked fine for me
Code:
//STEP0001 EXEC PGM=IKJEFT01,                                 
//             DYNAMNBR=20                                   
//SYSTSIN  DD  *                                             
DSN SYSTEM(DB2D)                                             
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARMS('SQL,1000') -     
LIB('DB2.POPR.PROD.RUNLIB.LOAD')                             
 END                                                         
//SYSTSPRT DD  SYSOUT=*                                       
//SYSPRINT DD  SYSOUT=*                                       
//SYSREC00 DD  DSN=HXSULL.UL.TEST,DISP=(NEW,KEEP),           
//             UNIT=SYSDA,                                   
//             SPACE=(TRK,(5,5),RLSE)                         
//SYSPUNCH DD  DSN=HXSULL.LOAD.CARDS(TEST),DISP=SHR           
//SYSOUT   DD  SYSOUT=*                                       
//SYSIN    DD  *                                             
  SELECT  CURRENT TIMESTAMP AS A,CURRENT TIMESTAMP AS B,     
  CAST('FA_NUM' AS CHAR(30)) AS C                             
  FROM SYSIBM.SYSDUMMY1;                                     
/*                                                           


Thank You,
Sushanth
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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