MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
Arian Beginner Joined: 24 Sep 2004 Posts: 10 Topics: 3
Posted: Fri Sep 24, 2004 1:50 pm Post subject: Dynamic controlcards
Hi,
my requirement is to generate a dynamic ftp controlcard statement.
mailbox..password...input file names all remain the same. Only the output file name needs to be changed.
Quote: ip address
maibox
pass
put 'my.dataset' rpt0924.txt
this sud be format for todays run.
IF the job is run tomorow the controlcard sud b like
Quote: ip address
maibox
pass
put 'my.dataset' rpt0925.txt
i'm trying to populate tis in a flat file and feed it as a controlcard ot my ftp setup.can this be done?
Back to top
superk Advanced Joined: 19 Dec 2002 Posts: 684 Topics: 5
Posted: Fri Sep 24, 2004 2:16 pm Post subject:
Presuming that you are using the NETRC DD to store and protect your address, logon, and password information, and that your input dataset is allocated to a specific DD, such as SYSUT1, then all you need is your program to create the "put" and (optionally "quit") statement(s):
Code:
put //DD:SYSUT1 rpt0924.txt
quit
This dataset should be allocated as FB, LRECL=80, and should be allocated to your INPUT DD.
Back to top
Arian Beginner Joined: 24 Sep 2004 Posts: 10 Topics: 3
Posted: Fri Sep 24, 2004 2:19 pm Post subject:
I'm not sure i understood you. I am looking for a SORT solution to do this.
Can we use SORT to populate the file the way i want ?
Back to top
superk Advanced Joined: 19 Dec 2002 Posts: 684 Topics: 5
Posted: Fri Sep 24, 2004 2:57 pm Post subject:
This DFSORT job should give you the desired results:
Code:
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
DUMMY RECORD
//SORTOUT DD DSN=...output
//SYSIN DD *
OPTION COPY
INREC FIELDS=(DATE1)
OUTFIL OUTREC=(1:C'put //DD:SYSUT1 ',
C'rpt',5,4,C'.txt',80:X,/,
1:C'quit')
/*
with this result:
put //DD:SYSUT1 rpt0924.txt
quit
Back to top
srinivasan_srisailan Beginner Joined: 18 May 2004 Posts: 11 Topics: 3
Posted: Fri Sep 24, 2004 5:19 pm Post subject:
The following JCL will help you to generate the desired FTP cards:
Code: //STEP EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD *
DUMMY
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC FIELDS=(DATE1)
OUTFIL REMOVECC,
OUTREC=(C'IP ADDRESS',/,C'MAILBOX',/,C'PASS',/,
C'PUT ''MY DATASET'' RPT',21:5,4,C'.TXT')
/*
Thanks,
Srinivasan
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Back to top
Arian Beginner Joined: 24 Sep 2004 Posts: 10 Topics: 3
Posted: Mon Sep 27, 2004 9:11 am Post subject:
Quote:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
PUT 'AAAAAAAA.BBBBBBBB.CCC' FILENAME
//SORTOUT DD DSN=xxx.yyy.zzz,(disp=shr)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL OUTREC=(C'SERVER NAME',/,
C'PASSWORD',/,
1,36,DATE1,C'.TXT',/,
C'QUIT',80:X)
/*
This code doesnt work ..says..there s a error in DATE1. I'm using SYNCSORT 3.7DR.
Please help me out
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Sep 27, 2004 10:35 am Post subject:
Arian,
Since you have older version of syncsort, the job will not not work. The following JCl will give you the desired results.
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DUMMY,DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)
//SORTOUT DD DSN=&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL HEADER1=(DATE=(4MD/))
/*
//STEP0200 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&T1,DISP=OLD
//SORTOUT DD SYSOUT=*,RECFM=FB
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL OUTREC=(C'SERVER NAME',/,
C'PASSWORD',/,
C'PUT ',
C'''',
C'AAAAAAAA.BBBBBBBB.CCC',
C'''',
C' FILENAME',
2,4,
7,2,
10,2,
C'.TXT',/,
C'QUIT',80:X)
/*
Hope this helps...
Cheers
kolusu
PS: Btw did the solution posted for summing records work? _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
Arian Beginner Joined: 24 Sep 2004 Posts: 10 Topics: 3
Posted: Mon Sep 27, 2004 10:49 am Post subject:
Kolusu,
This also worked great.
I tired to workaoround another problem, but couldtnt ..
What if i want the filename to be
Quote:
filenameQ1.txt for the first quarter
filenameQ2.txt for the second quarter.
I coudnt find a way to code a 'between' clause in the sort.
Can you help me out.
Thanks once again
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Sep 27, 2004 10:57 am Post subject:
Arian,
How do you define quarters?
If the date is between
Code:
January 1st - March 31st - first quarter
April 1st - June 30th - second quarter
July 1st - september 30th - third quarter
October 1st - December 31st - Fourth quarter
Is that what you want?
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
Phantom Data Mgmt Moderator Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Mon Sep 27, 2004 11:06 am Post subject:
Arian,
Considering Jan - Mar as first quarter, Apr - Jun as second quarter etc...as Kolusu specified above, the following JCL will yield u desired results.
Code:
//R010 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DUMMY,DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)
//SORTOUT DD DSN=&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL HEADER1=(DATE=(4MD/))
/*
//*
//R020 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&T1,DISP=OLD
//SORTOUT DD SYSOUT=*,RECFM=FB
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL OUTREC=(C'SERVER NAME',/,
C'PASSWORD',/,
C'PUT ',
C'''',
C'AAAAAAAA.BBBBBBBB.CCC',
C'''',
C' FILENAME',
7,2,CHANGE=(2,C'01',C'Q1',
C'02',C'Q1',
C'03',C'Q1',
C'04',C'Q2',
C'05',C'Q2',
C'06',C'Q2',
C'07',C'Q3',
C'08',C'Q3',
C'09',C'Q3',
C'10',C'Q4',
C'11',C'Q4',
C'12',C'Q4'),NOMATCH=(7,2),
C'.TXT',/,
C'QUIT',80:X)
/*
Phantom
Back to top
Arian Beginner Joined: 24 Sep 2004 Posts: 10 Topics: 3
Posted: Mon Sep 27, 2004 11:51 am Post subject:
Oh i should have loked at this possibility.
Thanks once again Kolusu
Back to top
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