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

Heading of fields and pipe de- limited


IBM Mainframe Forums -> FAQ & Basics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Simma Hemanth

New User


Joined: 05 Jul 2021
Posts: 7
Location: India

PostPosted: Wed Jul 07, 2021 4:48 pm
Reply with quote

Hi ,
I have to add heading of fields and pipe de-limited by using sort
The fields are
Code:
DB_TMSTAMP - STARTING POS 1 AND LENGTH 26
ERR_IMP - STARTING POS 27 AND LENGTH 8
ERR_ITR - STARTING POS 35 AND LENGTH 4


THANKS IN ADVANCE
Code'd and Edited
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1335
Location: Bamberg, Germany

PostPosted: Wed Jul 07, 2021 4:56 pm
Reply with quote

Your questions is? What have you tried? Show samples of Input and desired Output?
Back to top
View user's profile Send private message
Simma Hemanth

New User


Joined: 05 Jul 2021
Posts: 7
Location: India

PostPosted: Wed Jul 07, 2021 5:22 pm
Reply with quote

Code:

INPUT
// SYSIN   DD *

   OPTION COPY
   OUTREC  FIELDS=(1,26,27,8,35,4,39,12,51,4,BI,TO=ZD,LENGTH=9)

//*

OUTPUT
 TB_TMSTAMP                             ERR_PGM
2021-05-19-02.30.25.432101    ZST217P

HOW TO GIVE THE HEADING FOR THESE FIELDS
TB_TMSTAMP
ERR_PGM...ETC
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Wed Jul 07, 2021 6:40 pm
Reply with quote

1) your issue is neither JCL nor VSAM

2) your “INPUT” is not your input data, but a fragment of SORT utility statements

3) your actual input data is missing, and not commented in any manner

4) your output data is unclear; even: is it your actual output, or desired output, or smth. else?

5) remains unclear: do you want to ask something, or to demonstrate your efforts, or what? If you are asking: what exactly is your question - there is no one word around your CODE block…

6) the words “INPUT”, “OUTPUT”, and other unclear stuff is not a code; should not be enclosed into code-tags

7) please, clarify your sentence “pipe de-limited by using sort” - what do you mean by that?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Wed Jul 07, 2021 6:57 pm
Reply with quote

Welcome!
I moved under DFSORT/ICETOOL for now.

Look for HEADER1.
www.ibm.com/docs/en/zos/2.1.0?topic=outfil-headers
ibmmainframes.com/about39129.html

Going forward please use "SEARCH" first to find something , you will see plenty of similar issues discussed and resolved , give a try which will avoid posting basic questions and you will learn.
Back to top
View user's profile Send private message
Simma Hemanth

New User


Joined: 05 Jul 2021
Posts: 7
Location: India

PostPosted: Thu Jul 08, 2021 4:19 pm
Reply with quote

I was getting invalid overlapping field error, help me out

I/P LRECL=463
O/P LRECL= 173

Code:


//SYSIN DD*
   OPTION COPY
   OUTFIL FNAMES= SORTOUT,
   HEADER1=(1:C'DB_TMSTAMP',27:C'ERR_PGM',35:C'ERR_PARA_NO'
                    39:C'ERR_PGM_ACTION',51:C'ERR_MSG_NO',55:C'ERR_TYPE'
                     59:C'ERR_LEVEL',61:C'ERR_FIELD',79:C'ERR_CODE,
                    87:C'REGION',95:C'TRN_ID',99:C'TASK_NO',
                    121:C'SERVICE_NME',424:C'DB_USERID'),
   OUTREC=(1,26,27,8,35,4,39,12,51,4,BI,TO=ZD,LENGTH=9,
                    55,4,59,2,BI,TO=ZD,LENGTH=4,61,18,79,4,BI,TO=ZD,LENGTH=9,
                    87,8,95,4,99,4,BI,TO=ZD,LENGTH=9,121,50,424,8)
/*


WER118A  SORTOUT INVALID OVERLAPPING FIELDS


[b][/b]
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1335
Location: Bamberg, Germany

PostPosted: Thu Jul 08, 2021 4:44 pm
Reply with quote

Check where the fields in the HEADER1 are starting and what lengths you have specified (fields @35 and @55 and alikes). You will be able to fix that yourself.

Also this topic should be moved to SYNCSORT section of the forum.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Thu Jul 08, 2021 5:15 pm
Reply with quote

It would be nice to see (as has been asked several times): what is your desired output? How do you expect it to look like?

In the parameter HEADER1 all the specified fields are overlapping, except the last one.

In this simple case it is as obvious as a piece of cake. In a more complicated case it makes sense to start adding this large number of parameters one by one, in order to detect: which of them is causing the error?

When starting from a huge mess of keywords and values at once it’s getting very hard (or impossible) to find out: what is the problem?

P.S.
It remains a full mystery: what the “pipe-delimited SORT statement” does mean?
Back to top
View user's profile Send private message
Simma Hemanth

New User


Joined: 05 Jul 2021
Posts: 7
Location: India

PostPosted: Mon Jul 12, 2021 3:11 pm
Reply with quote

I got incompatible RECFM INCOMPATIBLE WITH REPORT WRITING. can u help me out from this

I/P LRECL= 463
O/P LRECL=193

Code:


// SYSIN DD*
     OPTION COPY
     OUTFIL FNAMES = SORTOUT
     HEADER1=( 1:C'DB_TMSTAMP',27:C'ERR_PGM',35:C'ERR_PARA_NO'
                              46:C'ERR_PGM_ACTION',60:C'ERR_MSG_NO',70:C'ERR_TYPE'
                              77:C'ERR_LEVEL',86:C'ERR_FIELD',104:C'ERR_CODE,
                              113:C'REGION',121:C'TRN_ID',127:C'TASK_NO',
                              136:C'SERVICE_NME',186:C'DB_USERID'),
   OUTREC=(1,26,27,8,35:35,4,46:39,12,60:51,9,
                              70:55,4,77:59,4,86:61,18,104:79,9,
                              113:87,8,121:95,4,127:99,9,136:121,50,186:424,8)
/*

SORTOUT HAS INCOMPATIBLE LRECL
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Mon Jul 12, 2021 4:55 pm
Reply with quote

Please, use the Calculator application to carefully calculate your real OUTREC size, by summarizing all field sizes. I, personally, refuse to do this calculation for yourself, but SORT utility did this, and displayed its message stating that the record size is wrong.

Please, verify the real LRECL parameter for your real dataset allocated to your //SORTOUT DD (not just your comment on expected record size!)
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Mon Jul 12, 2021 5:24 pm
Reply with quote

Hint:
Code:
186:C'DB_USERID'
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Mon Jul 12, 2021 6:59 pm
Reply with quote

BTW, there must be displayed extra messages from SORT, stating both LRECL of the output dataset, and the length of the record created by your OUTREC parameter. Those message would be useful for yourself, but you have ignored them, asking the forum instead…
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Mon Jul 12, 2021 7:04 pm
Reply with quote

And this is moved to Student Section apparently. Please research on errors and link provided, understand how HEADER1 works and do a test fixing one offset at a time from HEADER1 and DETAIL until you get successful.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Mon Jul 12, 2021 7:06 pm
Reply with quote

Something else that I do is I leave the LRECL off the JCL entirely.

This allows Syncsort to create the lrecl as it sees fit.

No mismatch errors then.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Mon Jul 12, 2021 7:25 pm
Reply with quote

daveporcelan wrote:
Hint:
Code:
186:C'DB_USERID'

This is the secondary reason.

The message “INCOMPATIBLE LRECL” means that the size of OUTREC= is not equal to the available value of SORTOUT LRECL. This is the primary reason which needs to be fixed first of all.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Mon Jul 12, 2021 7:37 pm
Reply with quote

I had to count on my fingers and this does come to 193.

Code:
186:424,8


This however comes to 194. Hence the error.

Code:
186:C'DB_USERID'

This is why I just leave it off the JCL, then no errors.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Mon Jul 12, 2021 8:52 pm
Reply with quote

daveporcelan wrote:
I had to count on my fingers and this does come to 193.

Code:
186:424,8


This however comes to 194. Hence the error.

Code:
186:C'DB_USERID'

This is why I just leave it off the JCL, then no errors.
In this case it will be different error even if you don't code RECFM and LRECL as HEADER1 don't match up with DETAIL on total length, In any other case ( without HEADER1) you are right.

Let us give chance to let TS figure that out. It is simple by now what to fix.
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 -> FAQ & Basics

 


Similar Topics
Topic Forum Replies
No new posts Pull data using date difference betwe... DB2 6
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
No new posts Converting unpacked fields to pack us... SYNCSORT 4
No new posts Data for newly added fields not displ... IMS DB/DC 6
Search our Forums:

Back to Top