MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

sort - how to write an additional record?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
coboladdict
Beginner


Joined: 02 Mar 2010
Posts: 15
Topics: 5

PostPosted: Wed Mar 10, 2010 11:57 am    Post subject: sort - how to write an additional record? Reply with quote

How can I write, with dfsort/syncsort, an additional record in the output file at the end of the processing?

I tried the "trailer1" option but it requires an specif recfm (it's meant to used in reports, I guess).

I'd like to determine the recfm and lrecl of this additional record, if possible.

Thanks.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Mar 10, 2010 12:13 pm    Post subject: Reply with quote

It's not clear what you want to do. Please be more specific. Show an example of your input records and what you expect for output. Give the RECFM and LRECL of the input and output files. Give the starting position, length and format of all relevant fields. Explain clearly what it is you want to do.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
coboladdict
Beginner


Joined: 02 Mar 2010
Posts: 15
Topics: 5

PostPosted: Wed Mar 10, 2010 12:35 pm    Post subject: Reply with quote

I can't post from my work place so I'm gonna do my best.
I want to read an idcams listcat sysout with dfsort, identify the dsn next to the string "nonvsam" and write a file "x" that will be used as the sysin in another idcams.
the text in the file "x" record can't be longer than 72 characters and so I need to have 2 lines (records) in this file.
Code:

//*
//sort exec pgm=sort
//sortin dd dsn=listcat.sysout,disp=shr
//sortout dd dsn=&&filex,disp=(new,pass,pass),...
//sysin dd *
sort fields=copy
include cond=(nn,6,eq,c'nonvsam')
outrec fields=(c' repro ids(",mm,44,c') outfile output')
//*
//idcams exec pgm=idcams
//sysout dd sysout=*
//sysin dd dsn=&&filex,disp=shr
//outfile dd dsn=...

in the way above, the record written in "filex" will have more that 72 chars and it will cause idcams to abend.
thanks.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Mar 10, 2010 1:33 pm    Post subject: Reply with quote

The LISTCAT output has RECFM=VB, so assuming you want &&filex to have RECFM=FB and LRECL=80, with the REPRO statement split across two lines, you can use these DFSORT statements:

Code:

  SORT FIELDS=COPY                                             
  INCLUDE COND=(5,6,CH,EQ,C'NONVSAM')                         
  OUTFIL VTOF,BUILD=(C' REPRO IDS(''',12,44,C''') -',80:X,/,   
    C'  OUTFILE OUTPUT')                                       

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mickeygoo
Beginner


Joined: 15 Nov 2007
Posts: 26
Topics: 7

PostPosted: Mon Mar 29, 2010 9:45 am    Post subject: Reply with quote

FWIW, HEADERn/TRAILERn were designed for reports, and will involve carriage control characters for them to work the way they were designed to work. I think this is what you were referring to when you said "TRAILER1 requires a specif recfm" - the carriage control characters require RECFM=FBA.

Having said that, you can suppress the carriage control by using the OUTFIL REMOVECC (REMOVE Carriage Control) operand.

Hope that helps...
_________________
Not an expert, but I did stay at a Holiday Inn... though it has been a while...
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Mar 29, 2010 11:27 am    Post subject: Reply with quote

And REMOVECC will also remove the need for the 'A' in the RECFM (e.g. it will use RECFM=FB instead of RECFM=FBA).
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group