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 

Pass Dynamic parameter to output file using sort

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


Joined: 13 Oct 2005
Posts: 84
Topics: 32
Location: INDIA

PostPosted: Wed Oct 14, 2009 3:16 pm    Post subject: Pass Dynamic parameter to output file using sort Reply with quote

Hi Friends

I need your help on following task

have to create a file dynamically with the contetnt using sort, we can achieve this thru the program ,but wanted to use sort.

file1
----------------------lrecl = 80
Code:

server pwd userid
path\file1.zip
----------------------


file2 - lrcal=80
-----------------------
Code:

cd /ftpdata                             
PUT 'JSABC.PDC.SEND'  ABDC****
quit

------------------------

output file should be

----------------------
Code:

server pwd userid
path\file1.zip ABDC****
------------------------


please help me on this

thank yoy
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Oct 14, 2009 3:45 pm    Post subject: Reply with quote

js01,

concatenate file 2 first in the list and use the following JCL. I assumed that your filename starts at position 23 for 50 bytes

Code:

//STEP0100 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD *                                                     
CD /FTPDATA                                                         
PUT 'JSABC.PDC.SEND'  ABDC****                                       
QUIT                                                                 
SERVER PWD USERID                                                   
PATH\FILE1.ZIP                                                       
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  SORT FIELDS=COPY                                                   
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'PUT'),PUSH=(23:23,50))
  OUTFIL IFOUTLEN=80,                                               
  INCLUDE=(1,6,CH,EQ,C'SERVER',OR,1,4,CH,EQ,C'PATH'),               
  IFTHEN=(WHEN=(1,6,CH,EQ,C'SERVER'),OVERLAY=(23:50X)),             
  IFTHEN=(WHEN=(1,4,CH,EQ,C'PATH'),                                 
  OVERLAY=(1,80,SQZ=(SHIFT=LEFT,MID=C' ')))                         
/*


the output of this is

Code:

SERVER PWD USERID       
PATH\FILE1.ZIP ABDC**** 

_________________
Kolusu
www.linkedin.com/in/kolusu
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