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
 

 

Running query in batch mode and formatting

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

New User


Joined: 20 Nov 2008
Posts: 14
Location: California USA

PostPosted: Thu Nov 20, 2008 4:59 am    Post subject: Running query in batch mode and formatting
Reply with quote

Hi,
I am running a spufi in batch mode and creating a flat file as an output.
Following is my query

Code:
UNLOAD TABLESPACE DB2 FORCE     
LOCK NO QUIESCE YES QUIESCECAT NO
SELECT   EMP_ID,
              EMP_Dept_No
FROM   EMP-TABLE         
      WITH UR;                     
      OUTDDN (SYSREC00)             
      LOADDDN SYSPUNCH             
      FORMAT USER (                 
      COL 1 NULLID NO TYPE CHAR(9),
      COL 2 NULLID NO TYPE CHAR(9),   

First two fields in the table are defined as S9(9) usage comp. In the ouput file I am getting leading spaces. I want leading zeroes instead.

Can you please guide me?

Thanks


Edited: Please use BBcode when You post some code, that's rather readable...Anuj
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2233
Location: @my desk

PostPosted: Thu Nov 20, 2008 9:04 am    Post subject:
Reply with quote

chavansu,

Which utility/program are you executing? Please post a few actual and expected output records.
Back to top
View user's profile Send private message
chavansu

New User


Joined: 20 Nov 2008
Posts: 14
Location: California USA

PostPosted: Thu Nov 20, 2008 11:15 pm    Post subject: Reply to: Running query in batch mode and formatting
Reply with quote

here i the code

Code:
//STEP010 EXEC PGM=INZUTILB
//        REGION=0M,TIME=1439,COND=(4,LT)             
//*                                                   
//STEPLIB  DD  DSN=SPP.DB2TOOL.LOAD,                 
//             DISP=SHR                               
//         DD  DSN=SYS1.DB2.LOAD,                     
//             DISP=SHR                               
//*                                                   
//SYSIN    DD  DSN=spufi to be run,       
//             DISP=SHR                               
//*                                                   
//SYSREC   DD  DSN=output file
//             DISP=(NEW,CATLG,DELETE),               
//             SPACE=(CYL,(10,10),RLSE),               
//             DCB=(BLKSIZE=0,LRECL=80,RECFM=FB)       
//*                                                   
//SYSOUT   DD  SYSOUT=P                         
//SYSPRINT DD  SYSOUT=P                           
//SYSDUMP  DD  SYSOUT=H                           
//SYSPUNCH DD  SYSOUT=P     
SPUFI i have already given in my query.
current output is
(blank)(blank)1234567(blank)(blank)1234567

desired ouput is
001234567001234567

Anuj I am sorry but I dont know how to use BB code
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Nov 21, 2008 3:53 am    Post subject:
Reply with quote

Hello,

Quote:
Anuj I am sorry but I dont know how to use BB code
At the top of the Reply panel are the "tags". Near the middle is the "Code" tag.

To use the Code tag, you can copy/paste your source, highlight the source, and click "Code". To see what your post will look like to the forum, click Preview. When you are satisfied with the appearance of your post, click Submit. In addition to readability, Code preserves alignment so you do not need to try to "space" things out to line up. Code also works well for jcl, utility control statements, and data.
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 Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts MIPS/CPU consumption reduction in Batch vishwakotin DFSORT/ICETOOL 4 Sat Mar 18, 2017 5:46 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts Determine Region with max bandwidth f... seahawk789 COBOL Programming 3 Mon Feb 27, 2017 8:26 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm


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