js01 Beginner
Joined: 13 Oct 2005 Posts: 84 Topics: 32 Location: INDIA
|
Posted: Wed Oct 14, 2009 3:16 pm Post subject: Pass Dynamic parameter to output file using sort |
|
|
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 |
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Oct 14, 2009 3:45 pm Post subject: |
|
|
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 |
|