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
 

 

Creating header record to a fiile

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
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    Post subject: Creating header record to a fiile
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Thu Feb 19, 2015 12:38 am    Post subject: Reply to: Creating header record to a fiile
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Thu Feb 19, 2015 12:50 am    Post subject: Reply to: Creating header record to a fiile
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    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Thu Feb 19, 2015 1:27 am    Post subject: Reply to: Creating header record to a fiile
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    Post subject:
Reply with quote

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Thu Feb 19, 2015 1:30 am    Post subject: Reply to: Creating header record to a fiile
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    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Thu Feb 19, 2015 4:31 am    Post subject: Reply to: Creating header record to a fiile
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm


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