View previous topic :: View next topic
Author
Message
Kunal Surpurkar New User Joined: 15 Nov 2012Posts: 47 Location: India
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
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
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
Kunal Surpurkar New User Joined: 15 Nov 2012Posts: 47 Location: India
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
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
Ah, your comma after HEADER1 is in column 72. Split the literal into two smaller ones.
Back to top
Kunal Surpurkar New User Joined: 15 Nov 2012Posts: 47 Location: India
Hi Bill,
Thanks for the reply
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
Kunal Surpurkar New User Joined: 15 Nov 2012Posts: 47 Location: India
Hi Bill,
I found my mistake.
43:34,3 should have been 34:34,3
Thanks
Back to top
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
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
Kunal Surpurkar New User Joined: 15 Nov 2012Posts: 47 Location: India
Could you give me the syntax for that please?
Back to top
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
It seems you want:
Back to top
Kunal Surpurkar New User Joined: 15 Nov 2012Posts: 47 Location: India
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
Back to top
Kunal Surpurkar New User Joined: 15 Nov 2012Posts: 47 Location: India
I need to adjust the length of the data with respect to header's field length.
Back to top
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
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
Kunal Surpurkar New User Joined: 15 Nov 2012Posts: 47 Location: India
Hello Bill,
Thanks for the help.
It worked
Back to top
Please enable JavaScript!