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 

Dynamic controlcards

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


Joined: 24 Sep 2004
Posts: 10
Topics: 3

PostPosted: Fri Sep 24, 2004 1:50 pm    Post subject: Dynamic controlcards Reply with quote

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?
Quote:
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Fri Sep 24, 2004 2:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
Arian
Beginner


Joined: 24 Sep 2004
Posts: 10
Topics: 3

PostPosted: Fri Sep 24, 2004 2:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Fri Sep 24, 2004 2:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
srinivasan_srisailan
Beginner


Joined: 18 May 2004
Posts: 11
Topics: 3

PostPosted: Fri Sep 24, 2004 5:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Sep 24, 2004 5:33 pm    Post subject: Reply with quote

Arian,

Please search before posting. This has been discussed earlier. Check this link

http://www.mvsforums.com/helpboards/viewtopic.php?t=2614&highlight=date1

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
Arian
Beginner


Joined: 24 Sep 2004
Posts: 10
Topics: 3

PostPosted: Mon Sep 27, 2004 9:11 am    Post subject: Reply with quote

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 Sad ..says..there s a error in DATE1. I'm using SYNCSORT 3.7DR.
Please help me out
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: Mon Sep 27, 2004 10:35 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Arian
Beginner


Joined: 24 Sep 2004
Posts: 10
Topics: 3

PostPosted: Mon Sep 27, 2004 10:49 am    Post subject: Reply with quote

Kolusu,
This also worked great.
I tired to workaoround another problem, but couldtnt ..Sad

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Sep 27, 2004 10:57 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Mon Sep 27, 2004 11:06 am    Post subject: Reply with quote

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
View user's profile Send private message
Arian
Beginner


Joined: 24 Sep 2004
Posts: 10
Topics: 3

PostPosted: Mon Sep 27, 2004 11:51 am    Post subject: Reply with quote

Oh i should have loked at this possibility.
Thanks once again Kolusu
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