Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all 8500 articles
Browse latest View live

JCL & VSAM :: RE: Mainframe dataset split

$
0
0
Author: RahulG31
Subject: Re: Reply to: Mainframe dataset split
Posted: Tue Aug 29, 2017 11:28 pm (GMT 5.5)

sergeyken wrote:
RahulG31 wrote:
In a JCL you have to tell how many datasets you would want as output and name those datasets.

If you want to do this dynamically then, you'll have to build your job on the go.

To do this, create a Cobol (or any other language) program, read the input dataset and write multiple output JCL statements (may be SORT as your program) and submit to Internal reader.

It is a very, very bad idea: to place each single header record in a separate dataset. It would make sense to split the input into three datasets: all headers, all data, and all trailers.

The idea to have "one record <-> one dataset" comes from a mind "not burdened with any knowledge of data processing methods"

As I already mentioned: it can be done technically (in many ways), but it is a stupid approach from the system architecture point of view.

Here is it again what TS wants:
Quote:
What I need is , to run a job and split my Dataset into separate datasets with each having data from 1st header to 1st footer in one dataset ,2nd header to 2nd footer in 2nd dataset and so on.

Nobody wants 3 datasets containing Header, data and footer. All TS wants is each Group in separate datasets.

I hope you understand by now.

I would request the moderators to delete the misleading/unnecessary posts by 'sergeyken' and clean up the thread.

.


DFSORT/ICETOOL :: RE: Repeat part of record multiple times

$
0
0
Author: RahulG31
Subject: Reply to: Repeat part of record multiple times
Posted: Tue Aug 29, 2017 11:35 pm (GMT 5.5)

I do not understand what is so complex about the requirement. It seems that it can be achieved by only doing a build as simple as:
Code:
BUILD=(1,9,1,4,1,4,1,4,1,4,1,4)


Learncoholic, please explain more about the complexity of the task.

.

DFSORT/ICETOOL :: RE: Join records from 2 files with No Duplicates using DFSORT

$
0
0
Author: Poha Eater
Subject: Join records from 2 files with No Duplicates using DFSORT
Posted: Wed Aug 30, 2017 12:00 am (GMT 5.5)

Hi All,

Thanks for all your responses. It was really helpful and informative. Let me reiterate my requirement and before that i accept that i didnt mention in my first post that in 2nd file when the key is same for 2 records but in these 2 records data is not same after the key. I did attached the screenshot of my File 2 which is showing different data for each row when there is duplicate key.

My requirement is - I have 2 files. Each files having a key of first 15 byte (starting from column 1 to 15). First file is having record length of 173 and second file has the record length of 251.

Both the files have exact same number of records. Suppose if file 1 has 1000 records then file 2 will also have 1000 records. In both the files, data only on first 15 bytes will be same, which is also key to my JOIN condition here.

In the output file, i have write all the 173 bytes of data from the File 1 and from File 2 i have to write the data of length 39 and starting from 28th byte.

In the File 1, when there is any record which is having duplicate key, the rest of the data in each record is also same whereas in File 2 whenever there is any duplicate key, the data in each record after the key (after the 15th byte) is not same and as per my requirement both files have exact same number of records so i have to join each row of both files and that is why i could not use the SUM FIELDS=NONE here because in File 2 it will remove the second record with same key but the second record have different data after the first 15 bytes from the first record with same key. I have attached the pics of File 2 data earlier. Pasting the data of File 2 below as well to show that it has different data in each row because i dont know how paste the image of file here. I tried using Img button, nothing is happening, i am sorry.

2307914558,,,,,,,,,,,,MD,1,2013,-62,,FVT,21117,LNL,20100
2307914558,,,,,,,,,,,,MD,1,2013,-93,,FVT,21117,LNL,8500G

Thank you magesh23586 for providing the resolution. The results are coming exactly as per the attached image from my first post, named as expected output.

Thanks all for your responses !!
_________________
Thanks !

DFSORT/ICETOOL :: RE: Repeat part of record multiple times

$
0
0
Author: Rohit Umarjikar
Posted: Wed Aug 30, 2017 12:54 am (GMT 5.5)

Haha, RahulG31, you spotted rightly. I don't know, why I had to think too much on that.
_________________
Regards,
Rohit Umarjikar
"Knowledge is knowing that a tomato is a fruit, but Wisdom is knowing not to put it in a fruit salad."icon_razz.gif

DFSORT/ICETOOL :: RE: SORT Trailer Count - LRECL Output controlled by Input (?)

$
0
0
Author: Rohit Umarjikar
Posted: Wed Aug 30, 2017 12:56 am (GMT 5.5)

The one I posted above is already working fine with OUTREC.
_________________
Regards,
Rohit Umarjikar
"Knowledge is knowing that a tomato is a fruit, but Wisdom is knowing not to put it in a fruit salad."icon_razz.gif

DFSORT/ICETOOL :: RE: SORT Trailer Count - LRECL Output controlled by Input (?)

$
0
0
Author: RahulG31
Subject: Reply to: SORT Trailer Count - LRECL Output controlled by Input (?)
Posted: Wed Aug 30, 2017 1:00 am (GMT 5.5)

amorante, Show the actual Job that you submitted (or want to modify) with DISP and DCB parameters for the output files.

.

JCL & VSAM :: RE: Mainframe dataset split

$
0
0
Author: sergeyken
Posted: Wed Aug 30, 2017 1:47 am (GMT 5.5)

The whole thing resembled me an old joke:

- Why are you digging this deep hole under the tree?
- I need to do it ASAP: my teacher in mathematics requested me to find a square root within an hour!

Let's continue finding square roots under trees...
_________________
Tyrannosaurus-REXX

DFSORT/ICETOOL :: RE: SORT Trailer Count - LRECL Output controlled by Input (?)

$
0
0
Author: amorante
Posted: Wed Aug 30, 2017 3:17 am (GMT 5.5)

Rohit approach is the correct one, thank you Rohit
_________________
alberto


DB2 :: RE: Extract Data till prev hour

$
0
0
Author: balaji81_k
Posted: Wed Aug 30, 2017 9:20 am (GMT 5.5)

Hi Every one ,

Thanks for every suggestion. As said earlier i am using COBOL code to handle the hour logic . This is how i handle and which is working for me.

Take date format like 'YYYYMMDD' from sales date and concat with Sales HR NBR . Take current date in YYYYMMDD and concat with Current hour .

If Current hour = 0 then move '23' to current hour else do nothing .
IF SALESDATE('YYYYMMDDHH') < CURRENT DATE(YYYYMMDDHH) then allow data to process else elminate those sales .

I am thinking now to perform the above by using Month, DAY,YEAR DB2 builtin functions but handling on current hour = 0 is still in question in extract Query . Can any one suggest whether to go with program or it can be handled in extract SQL Query .

Thanks
Balaji
_________________
dear peoples,
i want to join these this group in order to
enrich my knowledge in mainframe.

DB2 :: RE: Extract Data till prev hour

$
0
0
Author: balaji81_k
Subject: Reply to: Extract Data till prev hour
Posted: Wed Aug 30, 2017 9:58 am (GMT 5.5)

Hi Guys,

I come up with below queries to convert SALES_DATE and Current Date for the required format . Need to handle only for HOUR(CURRENT TIME ) = 0 th hour.


Code:


SELECT INT(REPLACE(CHAR(current date, ISO),'-','')) || HOUR(CURRENT TIME)
FROM SALES_TABLE

SELECT INT(REPLACE(CHAR(SALES_DATE, ISO),'-','')) || SUBSTR(DIGITS(SALES_HR_NBR),4,2)
FROM SALES_TABLE


Can any one please suggest me how we can handle the comparison when hour(current time = 0 ) AND <> 0 in extract Query as per program logic that i specified in the post . Mean while i will also try from my end.

Thanks
Balaji
_________________
dear peoples,
i want to join these this group in order to
enrich my knowledge in mainframe.

DFSORT/ICETOOL :: RE: Mainframe dataset split

$
0
0
Author: purushottam
Subject: Reply to: Mainframe dataset split
Posted: Wed Aug 30, 2017 12:15 pm (GMT 5.5)

The file which I have as input is containing data with different headers and trailers .

And for each set of headers and trailers , I need them to split in different datasets.


Please help me with some the solution in JCL , i tried using IEBGENER
to convert PS to PDS. But , i don't know how to use that with HEADERS and TRAILORS.


Thanks in Advance icon_smile.gif

PL/I & Assembler :: RE: Help with EXCP

$
0
0
Author: PeterHolland
Posted: Wed Aug 30, 2017 12:35 pm (GMT 5.5)

Quote:
multiple track search area


And what is that?

The HA and R0 are written using special CCW commands when the volume is formatted. There is not normally any reason to read or write these special records. User data begins with Record One (R1) and may be followed by additional user records. An empty track contains only the HA and R0.

DB2 :: RE: Extract Data till prev hour

$
0
0
Author: Marso
Posted: Wed Aug 30, 2017 3:06 pm (GMT 5.5)

I can add only one word: KISS

DFSORT/ICETOOL :: RE: Mainframe dataset split

$
0
0
Author: Marso
Posted: Wed Aug 30, 2017 3:41 pm (GMT 5.5)

Creating a dataset for each group of lines is not very practical.

What about creating a member in a PDSE for each group of lines ?

That would be much better and easier.

DFSORT/ICETOOL :: RE: Mainframe dataset split

$
0
0
Author: Marso
Subject: Re: Reply to: Mainframe dataset split
Posted: Wed Aug 30, 2017 4:04 pm (GMT 5.5)

purushottam wrote:
i tried using IEBGENER to convert PS to PDS. But , i don't know how to use that with HEADERS and TRAILERS.

Look at that:
Code:
//TEST01   EXEC PGM=IEBGENER
//SYSPRINT DD   SYSOUT=*   
//SYSUT1   DD   *           
123456789 --- HEADER 1     
AAAAAAAAAAAAA --- DATA 1   
BBBBBBBBBBBBBBBB --- DATA 1
CCCCCCCCCCCCCC --- DATA 1   
987654321 --- FOOTER 1     
123456789 --- HEADER 2     
AAAAAAAAAAAAA --- DATA 2   
BBBBBBBBBBBBBBBB --- DATA 2
987654321 --- FOOTER 2     
123456789 --- HEADER 3     
AAAAAAAAAAAAA --- DATA 3   
BBBBBBBBBBBBBBBB --- DATA 3
CCCCCCCCCCCCCC --- DATA 3   
DDDDDDDD --- DATA 3         
EEEEEEEEEEEEE --- DATA 3   
987654321 --- FOOTER 3     
123456789 --- HEADER 4     
AAAAAAAAAAAAA --- DATA 4   
BBBBBBBBBBBBBBBB --- DATA 4
CCCCCCCCCCCCCC -- DATA 4   
987654321 --- FOOTER 4                   
//SYSUT2   DD   DISP=SHR,DSN=my.existing.pdse
//SYSIN    DD   *                             
    GENERATE MAXNAME=4,MAXGPS=4 
    MEMBER NAME=MEMBER1         
GRP RECORD IDENT=(8,'98765432',1)
    MEMBER NAME=MEMBER2         
GRP RECORD IDENT=(8,'98765432',1)
    MEMBER NAME=MEMBER3         
GRP RECORD IDENT=(8,'98765432',1)
    MEMBER NAME=MEMBER4         
GRP RECORD IDENT=(8,'98765432',1)
/*

Input is no problem, it is your input dataset,
Output no problem either, it is your recipient PDSE (but must make sure members don't already exist),
SYSIN is what you have to build dynamically (I would use my sort product to do this)


DFSORT/ICETOOL :: RE: Mainframe dataset split

$
0
0
Author: purushottam
Subject: Re: Reply to: Mainframe dataset split
Posted: Wed Aug 30, 2017 4:28 pm (GMT 5.5)

Marso wrote:
purushottam wrote:
i tried using IEBGENER to convert PS to PDS. But , i don't know how to use that with HEADERS and TRAILERS.

Look at that:
Code:
//TEST01   EXEC PGM=IEBGENER
//SYSPRINT DD   SYSOUT=*   
//SYSUT1   DD   *           
123456789 --- HEADER 1     
AAAAAAAAAAAAA --- DATA 1   
BBBBBBBBBBBBBBBB --- DATA 1
CCCCCCCCCCCCCC --- DATA 1   
987654321 --- FOOTER 1     
123456789 --- HEADER 2     
AAAAAAAAAAAAA --- DATA 2   
BBBBBBBBBBBBBBBB --- DATA 2
987654321 --- FOOTER 2     
123456789 --- HEADER 3     
AAAAAAAAAAAAA --- DATA 3   
BBBBBBBBBBBBBBBB --- DATA 3
CCCCCCCCCCCCCC --- DATA 3   
DDDDDDDD --- DATA 3         
EEEEEEEEEEEEE --- DATA 3   
987654321 --- FOOTER 3     
123456789 --- HEADER 4     
AAAAAAAAAAAAA --- DATA 4   
BBBBBBBBBBBBBBBB --- DATA 4
CCCCCCCCCCCCCC -- DATA 4   
987654321 --- FOOTER 4                   
//SYSUT2   DD   DISP=SHR,DSN=my.existing.pdse
//SYSIN    DD   *                             
    GENERATE MAXNAME=4,MAXGPS=4 
    MEMBER NAME=MEMBER1         
GRP RECORD IDENT=(8,'98765432',1)
    MEMBER NAME=MEMBER2         
GRP RECORD IDENT=(8,'98765432',1)
    MEMBER NAME=MEMBER3         
GRP RECORD IDENT=(8,'98765432',1)
    MEMBER NAME=MEMBER4         
GRP RECORD IDENT=(8,'98765432',1)
/*

Input is no problem, it is your input dataset,
Output no problem either, it is your recipient PDSE (but must make sure members don't already exist),
SYSIN is what you have to build dynamically (I would use my sort product to do this)

Thanks a lot icon_smile.gif

It would be really nice if you guide me with that SYSIN DD * part , which is to be dynamically generated

DB2 :: RE: Extract Data till prev hour

$
0
0
Author: Nic Clouston
Posted: Wed Aug 30, 2017 4:54 pm (GMT 5.5)

If you have it working with a CCOBOL/SQL solution the stick to that - it is probably the optimal solution. Putting more work onto DB2 is going to slow down your data retrieval and, over the ages, impact every DB2 user/application.
_________________
Regards
Nic

PL/I & Assembler :: RE: Help with EXCP

$
0
0
Author: steve-myers
Posted: Wed Aug 30, 2017 5:16 pm (GMT 5.5)

You normally do a search for R0 to format write record R1, or to do a read count for R1, or to do a read multiple count-key-data for the track. As you say, ordinary programs seldom read the home address or R0. My track dump utility has an option to read and format HA and R0, but otherwise I leave them alone. It uses read multiple count-key-data to read the rest of the track. I use read count when doing a fast summary of a data set. My program to search out gas areas in a PDS uses long chains of read count multi-track commands; other than the directory it's not interested in the data.

I thought, incorrectly, that search key high equal would skip R0. Obviously it does in multi-track mode after switching tracks. The test program ran two searches, one for the first name, and one for the last name.

A PDS directory for a data set with many members typically extends over several tracks. For my test I used the PDS directory for SYS1.LINKLIB; in my system that's 14 tracks!

DB2 :: RE: Extract Data till prev hour

$
0
0
Author: balaji81_k
Posted: Wed Aug 30, 2017 7:20 pm (GMT 5.5)

Nic Clouston wrote:
If you have it working with a CCOBOL/SQL solution the stick to that - it is probably the optimal solution. Putting more work onto DB2 is going to slow down your data retrieval and, over the ages, impact every DB2 user/application.


Thanks Nic for the Advise.
_________________
dear peoples,
i want to join these this group in order to
enrich my knowledge in mainframe.

TSO/ISPF :: Historical/statistical details for members in a PDS?

$
0
0
Author: elixir1986
Subject: Historical/statistical details for members in a PDS?
Posted: Wed Aug 30, 2017 9:02 pm (GMT 5.5)

Hi,

I am interested to know details about the historical/statistical details for members in a PDS. Please find below,

Code:

BROWSE            JXXX.XXX.XXXX.XXXX                Row 0000001 of 000XXXX
Command ===>                                                  Scroll ===> CSR 
           Name     Prompt       Size    Init     [b]Mod[/b]      VV MM          ID

 


What I know so far?
VV is the version that is controlled thru version control tool. Please correct me if necessary?

MM is the number of times there is an EDIT made in the member and saved.

Please confirm what is Mod?

Also, please confirm what is the co-relation between "Mod"& "VV MM"

Thanks for all your replies

Viewing all 8500 articles
Browse latest View live