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 

Outputting DSN/PDS member with line numbers included

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


Joined: 28 May 2004
Posts: 29
Topics: 10

PostPosted: Thu Aug 05, 2004 9:49 am    Post subject: Outputting DSN/PDS member with line numbers included Reply with quote

I searched the forums for print+line+number, but could not find anything. I apologize if I'm asking a question that has already been answered...

Is there a way to output a dataset with line numbers as part of the output? I'd like to print some code, essentially a member from my source-lib PDS - OK, I actually, I don't want to physically print it; I want to output it to another DSN, or even to the JES print queue; I can use PRINT ODSN to get it to a downloadable dataset. Anyway, I want the line numbers to be part of the output.

Is there a parm in IKJEFT01 that will "attach" the line numbers? Or maybe there's a way to do that using SyncSort's COPY function?

Or maybe there's another utility I can use?

I can write a NATURAL or COBOL program to do it, but I was hoping to avoid that.....

Thanks in advance....

--Greg
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Aug 05, 2004 10:10 am    Post subject: Reply with quote

Greg

The following JCl will give the desired results. You need to use parm SEQNUM which will write out the record no for every record. In the following JCL, change the LRECL on outrec fields to your LRECL of the file. At the end of every record , the record no: of 8 bytes is printed. You can adjust the size of the seqnum to your requirement.

Code:

//STEP0100 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD DSN=YOUR.PDS(MEMBER),
//            DISP=SHR                             
//SORTOUT  DD DSN=YOUR OUTPUT FILE,
//            DISP=(NEW,CATLG,DELETE),             
//            UNIT=SYSDA,                           
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD  *                                   
  SORT FIELDS=COPY
  OUTREC FIELDS=(1,LRECL,SEQNUM,8,ZD)
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
gkreth
Beginner


Joined: 28 May 2004
Posts: 29
Topics: 10

PostPosted: Thu Aug 05, 2004 12:51 pm    Post subject: Reply with quote

That worked great! I modified it a bit to put the line numbers at the beginning, and to output the DSN to SYSOUT:
Code:
//SORTOUT  DD SYSOUT=X,RECFM=FBA 
//SYSIN    DD  *                 
  SORT FIELDS=COPY               
  OUTREC FIELDS=(SEQNUM,4,ZD,1,80)
Thanks a lot!
--Greg
Back to top
View user's profile Send private message
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