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 

2 output files with DSN

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


Joined: 05 Apr 2006
Posts: 56
Topics: 20

PostPosted: Wed Jun 14, 2006 11:16 am    Post subject: 2 output files with DSN Reply with quote

I received more than 300 files every day

Code:

P#MMA.IN.CPY.H1DG.MARXTR.D060613.T1507584
P#MMA.IN.CPY.H1DG.MARXTR.D060613.T1521331
P#MMA.IN.CPY.H1DG.MARXTR.D060613.T1533450
P#MMA.IN.CPY.H1DG.MARXTR.D060613.T1534389
--
--
--
P#MMA.IN.CPY.J273.MARXTR.D060613.T1100120
P#MMA.IN.CPY.J28T.MARXTR.D060613.T0359322
P#MMA.IN.CPY.K1R4.MARXTR.D060613.T0927117
P#MMA.IN.CPY.K1R4.MARXTR.D060613.T1112119

Some of them is different header
Code:

BROWSE    P#MMA.IN.CPY.H1DG.MARXTR.D060613.T0701259
 Command ===>                                       
********************************* Top of Data ******
AAAAAAHEADER.                    072006             

BROWSE    P#MMA.IN.CPY.K1R4.MARXTR.D060613.T0927117
 Command ===>                                       
********************************* Top of Data *******
AAAAAAHEADER RETRO               042006           

My question is, can we do in any way (UTILITIE, REXX, SAS) create 2 output files with DSN, if yes can you provide how to do it. Thank you all your help.

Output1
Code:

BROWSE    D2HG.CAP.OUTPUT                     
 Command ===>                                   
********************************* Top of Data **
P#MMA.IN.CPY.H1DG.MARXTR.D060613.T1507584       
P#MMA.IN.CPY.H1DG.MARXTR.D060613.T1521331       
P#MMA.IN.CPY.H1DG.MARXTR.D060613.T1533450       
P#MMA.IN.CPY.H1DG.MARXTR.D060613.T1534389       
--
--
******************************** Bottom of Data   

Output2
Code:

BROWSE    D2HG.RETRO.OUTPUT                   
 Command ===>                                 
********************************* Top of Data *
P#MMA.IN.CPY.H1DG.MARXTR.D060613.T1539212     
P#MMA.IN.CPY.K1R4.MARXTR.D060613.T0927117   
--
--   
******************************** Bottom of Data
Back to top
View user's profile Send private message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Wed Jun 14, 2006 1:50 pm    Post subject: Reply with quote

ldushkin,

Can you provide some more information on your requirement with a sample input and sample output ?
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
ldushkin
Beginner


Joined: 05 Apr 2006
Posts: 56
Topics: 20

PostPosted: Wed Jun 14, 2006 2:22 pm    Post subject: Reply with quote

My input is about 300 files, can be more, so if header is like this
AAAAAAHEADER. 072006
write in output file DSN of this file

If header is like this
AAAAAAHEADER RETRO 042006
write in output file DSN of this file
Back to top
View user's profile Send private message
bprasanna
Beginner


Joined: 05 Sep 2003
Posts: 119
Topics: 33
Location: Hyderabad

PostPosted: Wed Jun 14, 2006 2:41 pm    Post subject: Reply with quote

Hi,
Still not able to understand your requirement.Please elobarate a little bit more to have a correct and quick solution.

Shekar,did you got some thing from his second post ?

Thank you
Bprasanna
_________________
----------------
Thanks&Regards
Bprasanna
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Wed Jun 14, 2006 2:57 pm    Post subject: Reply with quote

I think is what the O/P is looking for:

From a list of about 300 dataset names, open each dataset, one-by-one, and read the first record.

If the contents of the first record look like:
AAAAAAHEADER. 072006
then write the DATASET NAME of the corresponding dataset to output file 1.

Else, if the contents of the first record look like:
AAAAAAHEADER RETRO 042006
then write the DATASET NAME of the corresponding dataset to output file 2.


Last edited by superk on Wed Jun 14, 2006 3:02 pm; edited 1 time in total
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 Jun 14, 2006 3:02 pm    Post subject: Reply with quote

bprasanna,

The requirement is a lil bit complex. Ldushkin receives 'n' number of files per day. And these files have a header record which may vary from file to file. So ldushkin wants to create 2 files based on the header record. But the trick here is to create the files with input filenames

Sort products do not have the ability of getting the input dataset name. SAS can do it. However it is tedious job as OP has 300 datasets.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Wed Jun 14, 2006 3:13 pm    Post subject: Reply with quote

Kolusu,Superk Prasanna,

My understading and presumed logic is :
Code:

SHEKAR.TEST.FILE1
SHEKAR.TEST.FILE2
SHEKAR.TEST.FILE3
SHEKAR.TEST.FILE4
SHEKAR.TEST.FILE5
SHEKAR.TEST.FILE6
SHEKAR.TEST.FILE7
SHEKAR.TEST.FILE8
SHEKAR.TEST.FILE9
SHEKAR.TEST.FILE10

If i have 10 files with the above file names,can we store the file names in a seperate dataset and code a pgm with this dataset as input ,that is read record by record till end of the file.

Once the first record is read SHEKAR.TEST.FILE1 store it to a variable and open the file with the variable which would read the file contents .Again read only the first record and check for the contents (AAAAAAHEADER. 072006 / AAAAAAHEADER RETRO 042006 ) if first one matches ,write the file name to output file1 else write it to output file2.

Is there any way in which we can store the datasets found in 3.4 say for example the 10 datasets above to store in a file through any means.
_________________
Shekar
Grow Technically
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 Jun 14, 2006 9:39 pm    Post subject: Reply with quote

Quote:

Is there any way in which we can store the datasets found in 3.4 say for example the 10 datasets above to store in a file through any means.


Once you get the listing of all files in 3.4 then type the following command at the command prompt.

Code:

Save List


The dataset listing will be saved as USERID. LIST.DATASETS.

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