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
 

 

How to update a portion of text in a trailer record
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Trinadh

New User


Joined: 05 Mar 2009
Posts: 18
Location: Pune

PostPosted: Wed Nov 09, 2016 9:41 pm    Post subject: How to update a portion of text in a trailer record
Reply with quote

Hi Team,

I'm trying to update a portion of a trailer record and facing error.
Can you please let me know how to achieve this?

Sort Card:

Code:
OUTFIL FNAMES=01,                         
   INCLUDE=(25,3,CH,EQ,C'XXX'),               
   IFTRAIL=(HD=YES,TRLID=(5,5,CH,EQ,C'TRAIL'),     
    TRLUPD=(1:C'TR1',30:COUNT=(M11,LENGTH=4)))   
OUTFIL FNAMES=02,                         
   INCLUDE=(25,3,CH,EQ,C'YYY'),               
   IFTRAIL=(HD=YES,TRLID=(5,5,CH,EQ,C'TRAIL'),     
    TRLUPD=(1:C'TR2',30:COUNT=(M11,LENGTH=4)))   
OUTFIL FNAMES=03,                         
   INCLUDE=(25,3,CH,EQ,C'ZZZ'),               
   IFTRAIL=(HD=YES,TRLID=(5,5,CH,EQ,C'TRAIL'),     
    TRLUPD=(1:C'TR3',30:COUNT=(M11,LENGTH=4)))


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

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Wed Nov 09, 2016 9:55 pm    Post subject:
Reply with quote

Quote:
I'm trying to update a portion of a trailer record and facing error.
We don't do guess work here , please post complete requirement and the error messages to get answers.
Back to top
View user's profile Send private message
Trinadh

New User


Joined: 05 Mar 2009
Posts: 18
Location: Pune

PostPosted: Wed Nov 09, 2016 10:15 pm    Post subject: Reply to: How to update a portion of text in a trailer record
Reply with quote

Apologies Rohit.
Please refer the below info required.

Input File:

Code:
HDRABC09112016
DATABCDEFGHIJKLMNOPQRSTUXXX
DATFSSFSAAKXCNVXPQWAAZXAZZZ
DATTWTELELELSFSAFAAFFDGDYYY
DATSFDSKKSGKDGDDKKGDKKDGZZZ
DATZFGHSDKGSHSGSGLJSLSFSXXX
DATCXHIUYTRNVMBIOPZSERFVZZZ
ZZZ TRAIL                      0006 

Output File 1:
Code:
HDRABC09112016
DATABCDEFGHIJKLMNOPQRSTUXXX
DATZFGHSDKGSHSGSGLJSLSFSXXX
TR1 TRAIL                      0002

Output File 2:
Code:
HDRABC09112016
DATTWTELELELSFSAFAAFFDGDYYY
TR2 TRAIL                      0001

Output File 3:
Code:
HDRABC09112016
DATFSSFSAAKXCNVXPQWAAZXAZZZ
DATCXHIUYTRNVMBIOPZSERFVZZZ
TR3 TRAIL                      0002

I'm facing U007 error when trying to modify the string present in position 1 using TRLUPD=(1:C'TR1',30:COUNT=(M11,LENGTH=4)
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Wed Nov 09, 2016 10:58 pm    Post subject: Reply to: How to update a portion of text in a trailer record
Reply with quote

Rohit asked for the messages. "I'm facing U007 error" is not the messages. Paste the full SYSOUT for the step.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Nov 09, 2016 11:07 pm    Post subject:
Reply with quote

Code:
OUTFIL FNAMES=01
'FNAMES' goes with ddnames used in the JCL whereas OUTFIL 'FILES' go with JCL dd suffixes such as '01' or '02' or '03'. And your ddnames in the JCL should be consistent with these.

So if you have output ddnames in the JCL as
Code:
//SORTOF01 DD DSN=...,
//SORTOF02 DD DSN=...,
//SORTOF03 DD DSN=...,
either use
Code:
OUTFIL FILES=01,...
OUTFIL FILES=02,...
OUTFIL FILES=03,...
OR
Code:

OUTFIL FNAMES=SORTOF01,...
OUTFIL FNAMES=SORTOF02,...
OUTFIL FNAMES=SORTOF03,....
I would not recommend the latter if you have SORTOFnn DDs because that is the whole purpose of having "FILES=nn"

While we wait for the complete SYSOUT messages, it might be worth verifying this in your JCL and control statements.

Also your control statements look for XXX,YYY OR ZZZ at position-25 to route to each output file, but in the sample input shown there is only ZZZ.
Can you also include a sample input representative enough to have data written into all the output files?
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Wed Nov 09, 2016 11:58 pm    Post subject:
Reply with quote

I don't think you can use 1:C'TR1' in TRLUPD, you may have to find another way to overlay in the trailer.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Nov 10, 2016 6:28 pm    Post subject:
Reply with quote

Did you read my previous post? It might not help if you do not post the relevant sysout messages and the JCL. When I ran your control statements as is, I am getting other syntax errors that do no appear in the SYSOUT from your last post.
Code:
            OPTION COPY         
            OUTFIL FNAMES=01,   
                          $     
ICE007A 0 SYNTAX ERROR         

Also, There was a question about the requirement which you have not responded to.
Back to top
View user's profile Send private message
Trinadh

New User


Joined: 05 Mar 2009
Posts: 18
Location: Pune

PostPosted: Thu Nov 10, 2016 7:46 pm    Post subject:
Reply with quote

Arun, the SORT FIELDS=COPY is missing in the control card which I pasted in my earlier post.

The sample input file has records with XXX, YYY and ZZZ, I'm not sure what is missing there. I think this could be with the spaces as I've copied the text from notepad.

Input File:


Code:
HDRABC09112016
 DATABCDEFGHIJKLMNOPQRSTUXXX
 DATFSSFSAAKXCNVXPQWAAZXAZZZ
 DATTWTELELELSFSAFAAFFDGDYYY
 DATSFDSKKSGKDGDDKKGDKKDGZZZ
 DATZFGHSDKGSHSGSGLJSLSFSXXX
 DATCXHIUYTRNVMBIOPZSERFVZZZ
ZZZ TRAIL                      0006
 


I'm facing issue when I try to modify using 1:'TR1' in TRLUPD.

As far I know the OVERLAY command used with IFTRAIL, ignores the trailer record.

Is there any other way I could achieve this.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Nov 10, 2016 7:55 pm    Post subject:
Reply with quote

Quote:
The sample input file has records with XXX, YYY and ZZZ

You're right. I was looking at pos-1 instead, my bad. I got errors with the FNAMES=01. Was wondering how it worked for you. Can you show your JCL DDnames?
Back to top
View user's profile Send private message
Trinadh

New User


Joined: 05 Mar 2009
Posts: 18
Location: Pune

PostPosted: Thu Nov 10, 2016 8:10 pm    Post subject:
Reply with quote

Its ok.

I've used FILES instead of FNAMES. Can you please give a try using this.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Thu Nov 10, 2016 8:33 pm    Post subject: Reply to: How to update a portion of text in a trailer record
Reply with quote

Trinadh,

I know you are capable with SORT, and usually work with SyncSORT.

Now you come here "unable to show the SYSOUT", with FNAMES= which gives a syntax error (and masses of other errors subsequent to that) and continue to insist that the error-marker points to the 30:.

Can you at least post the entire ICE201I messge, or if not, the first non-blank character after the message-number?

Did you read Rohit's post about the "1:C'"?

What's going on?

You are going to have to make that change on INREC or OUTREC.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Nov 10, 2016 8:42 pm    Post subject:
Reply with quote

Quote:
I've used FILES instead of FNAMES
Still your latest control card has FNAMES. It does not help if you are not showing what you actually tried.
Back to top
View user's profile Send private message
Trinadh

New User


Joined: 05 Mar 2009
Posts: 18
Location: Pune

PostPosted: Thu Nov 10, 2016 11:58 pm    Post subject:
Reply with quote

Arun,

I've tried the following the code

Code:
SORT FIELDS=COPY
OUTFIL FILES=01,                         
   INCLUDE=(25,3,CH,EQ,C'XXX'),               
   IFTRAIL=(HD=YES,TRLID=(5,5,CH,EQ,C'TRAIL'),     
    TRLUPD=(1:C'TR1',30:COUNT=(M11,LENGTH=4)))   
-----------------$
ICE007A SYNTAX ERROR
OUTFIL FILES=02,                         
   INCLUDE=(25,3,CH,EQ,C'YYY'),               
   IFTRAIL=(HD=YES,TRLID=(5,5,CH,EQ,C'TRAIL'),     
    TRLUPD=(1:C'TR2',30:COUNT=(M11,LENGTH=4)))   
-----------------$
ICE007A SYNTAX ERROR
OUTFIL FILES=03,                         
   INCLUDE=(25,3,CH,EQ,C'ZZZ'),               
   IFTRAIL=(HD=YES,TRLID=(5,5,CH,EQ,C'TRAIL'),     
    TRLUPD=(1:C'TR3',30:COUNT=(M11,LENGTH=4)))
 -----------------$
ICE007A SYNTAX ERROR

The marker has been pointed at "1:C", somehow it is showing at 30 when I pasted the content from notepad to this post.

Bill,

I would post the ICE201I messages tomorrow.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Fri Nov 11, 2016 12:55 am    Post subject: Reply to: How to update a portion of text in a trailer record
Reply with quote

The reason of your issue was given by Rohit a long time ago and then Bill reiterated and told you what you need to do:
Quote:
Did you read Rohit's post about the "1:C'"?

What's going on?

You are going to have to make that change on INREC or OUTREC.

I don't understand what is the point of having a further discussion on this?

.
Back to top
View user's profile Send private message
Trinadh

New User


Joined: 05 Mar 2009
Posts: 18
Location: Pune

PostPosted: Fri Nov 11, 2016 1:07 am    Post subject:
Reply with quote

Hi Rahul,

I'm aware of what is causing the issue and requesting the group that how I could I achieve this output through INREC or OUTREC along with IFTRAIL
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Fri Nov 11, 2016 1:12 am    Post subject: Reply to: How to update a portion of text in a trailer record
Reply with quote

Again, in either INREC or OUTREC you are going to have to use IFTHEN=(WHEN=(logicalcondition) to make the changes where you want to change other than overlaying COUNT or TOTAL on TRLUPD. Or, if you can otherwise recreate the trailer, drop the original and use TRAILER1 to create a new one.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Nov 11, 2016 1:17 am    Post subject:
Reply with quote

Rahul, there were multiple issues as you might have noticed already - the attempt of overlaying a constant in TRLUPD subparameter, and the usage of FNAMES instead of FILES. And it took several posts to show what was actually tried. At least in his last post he did that.

The OP seems to have solved the FNAMES error, and for the other main problem, Bill has made a clear suggestion but am not sure if it came to the OP's notice. Lets hope if he tries something based on that, and comes up with something.

Another option is to build a new trailer using TRAILER1 in the OUTFIL omitting the existing trailer (assuming other fields are the constants shown in the example) instead of updating the existing trailer using IFTRAIL

EDIT: I think by the time I made this post, 2 other posts came in. Bill-Sorry abt that.
Back to top
View user's profile Send private message
Trinadh

New User


Joined: 05 Mar 2009
Posts: 18
Location: Pune

PostPosted: Mon Nov 14, 2016 2:45 pm    Post subject:
Reply with quote

Hi Bill,

I've tried implementing OUTREC IFTHEN code and facing the errors stated below.

Code:
SORT FIELDS=COPY
OUTFIL FILES=01,                         
   INCLUDE=(25,3,CH,EQ,C'XXX'),               
   IFTRAIL=(HD=YES,TRLID=(5,5,CH,EQ,C'TRAIL'),     
    TRLUPD=(1:C'TR1',30:COUNT=(M11,LENGTH=4)))
   OUTREC IFTHEN=(WHEN=((1,3,CH,EQ,C'ZZZ')),
       OVERLAY=(1:C'TR1')) 
OUTFIL FILES=02,                         
   INCLUDE=(25,3,CH,EQ,C'YYY'),               
   IFTRAIL=(HD=YES,TRLID=(5,5,CH,EQ,C'TRAIL'),     
    TRLUPD=(1:C'TR2',30:COUNT=(M11,LENGTH=4)))
OUTREC IFTHEN=(WHEN=((1,3,CH,EQ,C'ZZZ')),
       OVERLAY=(1:C'TR2')) 
$
ICE005A BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
OUTFIL FILES=03,                         
   INCLUDE=(25,3,CH,EQ,C'ZZZ'),               
   IFTRAIL=(HD=YES,TRLID=(5,5,CH,EQ,C'TRAIL'),     
    TRLUPD=(1:C'TR3',30:COUNT=(M11,LENGTH=4)))
OUTREC IFTHEN=(WHEN=((1,3,CH,EQ,C'ZZZ')),
ICE002I DUPLICATE OR CONFLICTING OUTREC STATEMENT
       OVERLAY=(1:C'TR3'))
$
ICE005A BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY

I tried INREC IFTHEN too and facing the same error codes.

Can you please let me know how this can be achieved?

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Mon Nov 14, 2016 3:34 pm    Post subject: Reply to: How to update a portion of text in a trailer record
Reply with quote

Has someone hijacked your account, or your name? I suppose if someone has, they're hardly going to say "yes". Or, I'm beginning to believe, I have been mislead by "3NADH" into thinking you are someone else :-)

Anyway. Sort control cards can't start in column one.

This isn't you, is it?
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Mon Nov 14, 2016 7:11 pm    Post subject:
Reply with quote

Quote:
I tried INREC IFTHEN too and facing the same error codes
One of the suggestions made earlier was to have a separate INREC/OUTREC (and this can occur only once per control card), so you cannot embed this into each of your OUTFIL groups.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
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
This topic is locked: you cannot edit posts or make replies. Sort card to replace text using cross... Susanta SYNCSORT 32 Tue Sep 13, 2016 4:17 pm


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