IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Creating header record to a fiile


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Kunal Surpurkar

New User


Joined: 15 Nov 2012
Posts: 47
Location: India

PostPosted: Thu Feb 19, 2015 12:15 am
Reply with quote

Hi Team,

I have a requirement where I need to build a header record for a file.
I am using the HEADER1 and OUTFIL statements to do that. However, I am facing SYNTAX error.

My input file :

Code:
 ----+----1----+----2----+----3----+----4----+----5----+----6----
 ***************************** Top of Data **********************
 3042270809901|05|1639133515|001|02|20130118|1639133515|001|01| 
 3045264005401|05|1013913458|001|02|20130204|1013913458|001|01| 


Below is my SYSIN card : Only for first 4 fields. I am first trying to build a header for the first 4 fields.

Code:
OUTFIL REMOVECC,                                                     
  HEADER1=('HIST   CCN   ;CT ;HIST NPI  ;HIST LOC NO;HIST OWNER NO;'),
  BUILD=(1,14,15:15,3,18:18,11,30:29,4,                               
         43:33,3)     


Can anyone help me with the correct syntax please?

Code'd
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

PostPosted: Thu Feb 19, 2015 12:38 am
Reply with quote

You need to paste the error from the sysout of the failing step. At the moment, I can only see OUTFIL starting in column one. Column one should be blank, always, except for a comment (*).
Back to top
View user's profile Send private message
Kunal Surpurkar

New User


Joined: 15 Nov 2012
Posts: 47
Location: India

PostPosted: Thu Feb 19, 2015 12:41 am
Reply with quote

Hi,

Thanks for the quick response.

This is the SYSIN card used:
Code:
//SYSIN    DD    *                                                     
  OPTION COPY                                                           
  OUTFIL REMOVECC,                                                     
    HEADER1=('HIST   CCN   ;CT ;HIST NPI  ;HIST LOC NO;HIST OWNER NO;'),
    BUILD=(1,14,15:15,3,18:18,11,30:29,4,                               
           43:33,3)                               


This is the error:

Code:
  OPTION COPY                                                           
  OUTFIL REMOVECC,                                                     
    HEADER1=('HIST   CCN   ;CT ;HIST NPI  ;HIST LOC NO;HIST OWNER NO;'),
    BUILD=(1,14,15:15,3,18:18,11,30:29,4,                               
    *                                                                   
           43:33,3)                                                     
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR             
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

PostPosted: Thu Feb 19, 2015 12:50 am
Reply with quote

Ah, your comma after HEADER1 is in column 72. Split the literal into two smaller ones.
Back to top
View user's profile Send private message
Kunal Surpurkar

New User


Joined: 15 Nov 2012
Posts: 47
Location: India

PostPosted: Thu Feb 19, 2015 1:19 am
Reply with quote

Hi Bill,

Thanks for the reply icon_smile.gif

I corrected it and ran the job again, It went fine. However, the format of the report is not as expected.

Please see the below report :
Code:

 HIST   CCN   ;CT;HIST NPI  ;HIST LOC NO;HIST OWNER NO;
 3042270809901|05|1639133515|0         01| 


As you can see above, In HIST LOC NO, it should be 001..But, it is appearing as 0 01.

Here is the sysincard :
Code:

//SYSIN    DD    *                                                     
  OPTION COPY                                                           
  OUTFIL REMOVECC,                                                     
  HEADER1=('HIST   CCN   ;CT;HIST NPI  ;HIST LOC NO;HIST OWNER NO;'),   
    BUILD=(1,14,15:15,3,18:18,12,30:30,4,                               
           43:34,3)   
Back to top
View user's profile Send private message
Kunal Surpurkar

New User


Joined: 15 Nov 2012
Posts: 47
Location: India

PostPosted: Thu Feb 19, 2015 1:25 am
Reply with quote

Hi Bill,

I found my mistake.

43:34,3 should have been 34:34,3


Thanks icon_smile.gif
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

PostPosted: Thu Feb 19, 2015 1:27 am
Reply with quote

If you don't need to include any blanks, just code it all in one shot: BUILD=(1,length-you-need). Less error-prone, easier to maintain.
Back to top
View user's profile Send private message
Kunal Surpurkar

New User


Joined: 15 Nov 2012
Posts: 47
Location: India

PostPosted: Thu Feb 19, 2015 1:28 am
Reply with quote

Could you give me the syntax for that please?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

PostPosted: Thu Feb 19, 2015 1:30 am
Reply with quote

It seems you want:
Code:

  BUILD=(1,36)
Back to top
View user's profile Send private message
Kunal Surpurkar

New User


Joined: 15 Nov 2012
Posts: 47
Location: India

PostPosted: Thu Feb 19, 2015 1:34 am
Reply with quote

Thanks.

If I do that,

The report is as below:
Code:

HIST   CCN   ;CT;HIST NPI  ;HIST LOC NO;HIST OWNER NO;
3042270809901|05|1639133515|001|         



HIST LOC NO's value is 001. So, 001 should be under HIST LOC NO.

Ideally, it should be

Code:
HIST LOC NO;
        001|
Back to top
View user's profile Send private message
Kunal Surpurkar

New User


Joined: 15 Nov 2012
Posts: 47
Location: India

PostPosted: Thu Feb 19, 2015 2:42 am
Reply with quote

I need to adjust the length of the data with respect to header's field length.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

PostPosted: Thu Feb 19, 2015 4:31 am
Reply with quote

I'm not quite sure what you want, but play around with this till you get what you want:

Code:
  OPTION COPY
  OUTFIL REMOVECC,
    HEADER1=('HIST   CCN   ; CT; HIST NPI  ; ',
             'HIST LOC NO; HIST OWNER NO;'),
    BUILD=(1,14,X,15,3,X,18,11,9X,29,4,12X,33,3)


X is a blank. When there is a number in front of the X, you get that many blanks.
Back to top
View user's profile Send private message
Kunal Surpurkar

New User


Joined: 15 Nov 2012
Posts: 47
Location: India

PostPosted: Thu Feb 19, 2015 10:30 am
Reply with quote

Hello Bill,

Thanks for the help.
It worked icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. how to extract a portion (e.g. fields... SYNCSORT 8
This topic is locked: you cannot edit posts or make replies. Writng matched records into output fi... DFSORT/ICETOOL 11
No new posts Compare the file record count percent... DFSORT/ICETOOL 4
No new posts Record count of RECFM=U tape file DFSORT/ICETOOL 17
No new posts Checking the total counts inside a re... JCL & VSAM 5
Search our Forums:

Back to Top