2 output files with DSN
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Utilities

#1: 2 output files with DSN Author: ldushkin PostPosted: Wed Jun 14, 2006 11:16 am
    —
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

#2:  Author: shekar123Location: Bangalore India PostPosted: Wed Jun 14, 2006 1:50 pm
    —
ldushkin,

Can you provide some more information on your requirement with a sample input and sample output ?

#3:  Author: ldushkin PostPosted: Wed Jun 14, 2006 2:22 pm
    —
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

#4:  Author: bprasannaLocation: Hyderabad PostPosted: Wed Jun 14, 2006 2:41 pm
    —
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

#5:  Author: superk PostPosted: Wed Jun 14, 2006 2:57 pm
    —
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

#6:  Author: kolusuLocation: San Jose PostPosted: Wed Jun 14, 2006 3:02 pm
    —
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

#7:  Author: shekar123Location: Bangalore India PostPosted: Wed Jun 14, 2006 3:13 pm
    —
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.

#8:  Author: kolusuLocation: San Jose PostPosted: Wed Jun 14, 2006 9:39 pm
    —
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



MVSFORUMS.com -> Utilities


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group