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 

Building Control Card Dynamically

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


Joined: 11 Apr 2005
Posts: 42
Topics: 19
Location: India

PostPosted: Thu Jul 14, 2005 1:41 pm    Post subject: Building Control Card Dynamically Reply with quote

Hi,

I have file say ABC.CONTROL.FILE which contains one record with the timestamp in YYYYMMDDHHMMSS format as its first field. The record in all is 28 bytes long.
The layout of this file is:

01 Abc-Control-File.
05 Timestamp PIC X(14).
05 Filler PIC X(14).

Problem Statement:
Using this file I need to build a FTP control card which contains 7 records. Here is a sample FTP control card:

Record1 contains IP Address : 11.22.33.44
Record2 contains user Id : used_Id
Record3 contains Passcode : Pass_Code_abc
Record4 contains Format : ASCII
Record5 contains FTP statement : PUT 'ABC.CONTROL.FILE' em_Timestamp.dat
Record6 contains FTP command : CLOSE
Record7 contains FTP command : QUIT

Now, in the Record 5 of the control card, the timestamp field from the ABC.CONTROL.FILE is to be populated to build the name of the destination file [basically, its the name of ABC.CONTROL.FILE on the server with IP mentioned in the control card]. ONLY the timestamp field needs to be changed, all the other fields in the FTP card remain as they are.

ABC.CONTROL.FILE is created once everyday. Therefore the Control card all needs to be created everyday (with the new destination file name, from the timestamp field in the control file).

Could you please help me achieve this using SYNCSORT?

Thanks for your time.
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Thu Jul 14, 2005 3:40 pm    Post subject: Reply with quote

Would this work for you?
Code:

//STEP0001 EXEC PGM=SORT                                         
//SORTIN   DD   DISP=SHR,DSN=ABC.CONTROL.FILE                   
//SORTOUT  DD   SYSOUT=*                                         
//SYSOUT   DD   SYSOUT=*                                         
//SYSIN    DD   *                                               
 SORT FIELDS=COPY                                               
 OUTFIL OUTREC=(1:C'11.22.33.44',80:X,/,1:C'USER-ID',/,         
   1:C'PASSWORD',/,1:C'ASCII',/,1:C'PUT ''ABC.CONTROL.FILE''',X,
   C'EM_',1,14,C'.DAT',/,1:C'CLOSE',/,1:C'QUIT')                 
/*                                                               
//                                                               
Back to top
View user's profile Send private message
Siddheart22
Beginner


Joined: 11 Apr 2005
Posts: 42
Topics: 19
Location: India

PostPosted: Thu Jul 14, 2005 4:15 pm    Post subject: Reply with quote

Thanks Superk.

It did work!
Regards,
Back to top
View user's profile Send private message
heman
Beginner


Joined: 17 Aug 2005
Posts: 18
Topics: 4

PostPosted: Thu Aug 18, 2005 2:45 am    Post subject: Reply with quote

Hi Superk,

In the solution given by you above, where are we updating the existing control card. Please consider that the control card will be a member in a PDS.

Thanks,
Heman.
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: Thu Aug 18, 2005 8:14 am    Post subject: Reply with quote

Quote:

In the solution given by you above, where are we updating the existing control card. Please consider that the control card will be a member in a PDS.


Heman,

You can use the same pds member to do an update in place but , if something goes wrong you will loose the original data. So it is always a good idea to create a create temporary dataset with the changes and then replace the input with the temp dataset.

In other topic of yours I posted a solution to create dynamic control cards.

Kolusu
_________________
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