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

TSO/ISPF :: RE: How to change a string containing the command delimiter

$
0
0
Author: Nic Clouston
Posted: Tue Aug 29, 2017 4:56 pm (GMT 5.5)

Do not resuurect old topics - 11 YEARS this has been sleeping quietly! Even 6 months is too long.
_________________
Regards
Nic


DB2 :: RE: Extract Data till prev hour

$
0
0
Author: Marso
Posted: Tue Aug 29, 2017 5:02 pm (GMT 5.5)

prino wrote:
Use timestamps


What prino meant was:
Code:
WHERE TIMESTAMP(SALES_DATE,CONCAT(SALES_HR_NBR,':00:00'))
      BETWEEN (CURRENT TIMESTAMP - 2 DAYS)
          AND (CURRENT TIMESTAMP - 1 HOURS)

Adjust the DAYS and HOURS until you're satisfied.

If you plan to write more DB2, then you must have this book open on your desktop: SQL Reference (search for the one corresponding to your DB2 version)

TSO/ISPF :: RE: How to change a string containing the command delimiter

$
0
0
Author: chong.zhou
Posted: Tue Aug 29, 2017 5:07 pm (GMT 5.5)

Marso wrote:
It is better to start a new topic, even if the question is related.

Now, two correct answers:
1. it is always possible to do multiple changes (first change X'5E' to something unusual like ~ [X'A1'], then change 'A~B~C' to whatever, then back from X'A1' to X'5E')

2. Change the command delimiter (Option 0 for ISPF Settings, change command delimiter to something unusual like ~) then 'A;B;C' will work.


Cool. I like the second idea, because sometimes the purpose of including semi-colons in the search pattern is just for more accurate matching.

All Other Mainframe Topics :: RE: Skip file from delete

$
0
0
Author: pema_yozer
Posted: Tue Aug 29, 2017 6:02 pm (GMT 5.5)

the below is the input to my delete utility

FIND DSNAME=EHLT.EC.TRAN.!KTEC!FILE ** !=SELECT VARIABLE
DELETE

we have files such as
EHLT.EC.TRAN.KTECBJ00.IFILE1.GDG
EHLT.EC.TRAN.KTECBJ00.IFILE1


the above FIND is picking both the layout, any idea on skipping the GDG one but picking the regular one without the GDG

All Other Mainframe Topics :: RE: Failure after DIR command

$
0
0
Author: Hank Watson
Posted: Tue Aug 29, 2017 6:46 pm (GMT 5.5)

Appreciate your response. I had hoped for a miracle, because all my reading led me to believe that we would have to turn on logging or tracing. I guess we'll just wait for it to happen a third time and engage the network team. As you said, it will prove difficult if not impossible to find it. The job executes 27 FTP's and most of them include a dir command before and/or after the put. The two instances we had were 15 days apart and are the first we've seen since running this job (first implemented in 2009 with many fewer steps).

I had been hoping that it was a PORT issue with the return path, but the two that failed used ports that had been used on other days. So, the it's a firewall rule issue got thrown away.

JCL & VSAM :: RE: Mainframe dataset split

$
0
0
Author: sergeyken
Subject: Re: Mainframe dataset split
Posted: Tue Aug 29, 2017 7:07 pm (GMT 5.5)

purushottam wrote:
Some one please guide me with appropriate solution using JCL .

JCL solution is very simple:
Code:
//SPLIT EXEC PGM={splitter program}
//SYSPRINT DD  SYSOUT=*     printed log
//INPUT    DD  DISP=SHR,DSN={your input dataset}
//HEADER1  DD  DSN={...}
// . . . . . . . . .
//DATAONLY DD  DSN={...}
//FOOTER1  DD  DSN={...}
// . . . . . . . . .
//SYSIN    DD  *
 . . . {control statements for splitter program} . . . . . .
//*


P.S.
It is a very bad idea, to place unknown number of "headers", and "footers" into unpredicted number of datasets. It is possible to implement, but it is a stupid idea.
_________________
Tyrannosaurus-REXX

All Other Mainframe Topics :: RE: Skip file from delete

$
0
0
Author: sergeyken
Posted: Tue Aug 29, 2017 7:12 pm (GMT 5.5)

pema_yozer wrote:
the below is the input to my delete utility

FIND DSNAME=EHLT.EC.TRAN.!KTEC!FILE ** !=SELECT VARIABLE
DELETE

we have files such as
EHLT.EC.TRAN.KTECBJ00.IFILE1.GDG
EHLT.EC.TRAN.KTECBJ00.IFILE1


the above FIND is picking both the layout, any idea on skipping the GDG one but picking the regular one without the GDG

Your question has nothing to do with "JCL & VSAM" topics.
_________________
Tyrannosaurus-REXX

TSO/ISPF :: RE: How to change a string containing the command delimiter

$
0
0
Author: sergeyken
Subject: Re: find or replace command
Posted: Tue Aug 29, 2017 7:17 pm (GMT 5.5)

chong.zhou wrote:
c 'A;B;C' 'A-B-C' all

I tried "AX'E5'B" and 'AX"E5"B', none worked. How do you put the X'5E' in the middle of a string? Thanks!

For relatively short strings you also can code it whole in hex:
Code:
c  X'C1E5C2E5C3'  'A-B-C' all

Another (less safe) approach is, using "picture" characters
Code:
c  P'A$B$C'  'A-B-C' all

('$' stands for "any special character, neither alphabetic nor numeric")
_________________
Tyrannosaurus-REXX


TSO/ISPF :: RE: How to change a string containing the command delimiter

$
0
0
Author: chong.zhou
Posted: Tue Aug 29, 2017 8:10 pm (GMT 5.5)

Thank you sergeyken. Your 1st idea can't be better. Great!!

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

$
0
0
Author: amorante
Subject: SORT Trailer Count - LRECL Output controlled by Input (?)
Posted: Tue Aug 29, 2017 8:57 pm (GMT 5.5)

I have a Sort improvement I would like to make ,
Requirement: Input (25 bytes) SORTOF3 (80 bytes)
//STEP0A2 EXEC PGM=SORT
//SORTIN DD dsn=filename ( lrecl=25)
//SORTOUT DD DSN=fileout (lrecl=25)
//SORTOF2 DD DSN=fileof2 (lrecl=25)
//SORTOF3 DD DSN=fileof3 ( need this to be 80 )
//SYSIN DD *
SORT FIELDS=(1,25,CH,A)
SUM FIELDS=NONE
OUTFIL FILES=(OUT)
OUTFIL FILES=(2)
OUTFIL FILES=(3),REMOVECC,NODETAIL,
TRAILER1=(1:'I000000002000000001000',COUNT=(M11,LENGTH=15),43C' ')

This fails with :
ICE222A 0 25 BYTE FIXED RECORD LENGTH IS NOT EQUAL TO 80 BYTE LRECL FOR SORTOF3

How can I convert :
OUTFIL FILES=(3),REMOVECC,NODETAIL,
TRAILER1=(1:'I000000002000000001000',COUNT=(M11,LENGTH=15),43C' ')

To:
OUTFIL FILES=(3),REMOVECC,NODETAIL,
Replacing the trailer1 with a statement
USING Outrec or Build so the output LRECL = 80

Why:
All I need Is to count the number of record in sortin…. Output format as shown, question is can I do it in the same step or do I have to add another step and then
I could alter the input using INREC to go up to 80 and then use trailer1 for sortof3,
( this changes sortof2 and sortout to be 80 which is no good, that is why I would have to add another step, seriously ?)
_________________
alberto

DB2 :: RE: Extract Data till prev hour

$
0
0
Author: Rohit Umarjikar
Posted: Tue Aug 29, 2017 9:41 pm (GMT 5.5)

You can also do one thing,
Before you hit the sql above manipulate "CURRENT DATE " upfront based on your rules.
for e.g. if you want 12:10 AM of current day still to be treated as previous day then so be it, move current date -1 day else current date to some host variable and use it instead of "Current date: in you query in stead of a complex and tricky logic.
Check with scheduling team too if they can help you with something partially or fully to solve this timing issues.
_________________
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: Tue Aug 29, 2017 10:07 pm (GMT 5.5)

Welcome!!
Please make a use of code tags.
Code:
//STEP0A2 EXEC PGM=SORT
 //SORTIN DD dsn=filename ( lrecl=25)
 //SORTOUT DD DSN=fileout (lrecl=25)
 //SORTOF2 DD DSN=fileof2 (lrecl=25)
 //SORTOF3 DD DSN=fileof3 ( need this to be 80 )
 //SYSIN DD *
 SORT FIELDS=(1,25,CH,A)
 SUM FIELDS=NONE
 OUTFIL FILES=(OUT)
 OUTFIL FILES=(2)
 OUTFIL FILES=(3),REMOVECC,NODETAIL,OUTREC=(80X),
 TRAILER1=(1:'I000000002000000001000',COUNT=(M11,LENGTH=15))

_________________
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: Join records from 2 files with No Duplicates using DFSORT

$
0
0
Author: Rohit Umarjikar
Posted: Tue Aug 29, 2017 10:12 pm (GMT 5.5)

Quote:
Eliminating duplicate keys via SUM FIELDS=NONE will create a single matching record produced, but (in general case) created from an unpredicted pair of matching keys.

He could use SUM FIELDS on one ds to get what he wants.
Poha Eater, please respond to to clear the air of doubts in the requirements to get it further moving else it can be locked.
_________________
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

JCL & VSAM :: RE: Mainframe dataset split

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

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.

.

JCL & VSAM :: RE: Mainframe dataset split

$
0
0
Author: Robert Sample
Posted: Tue Aug 29, 2017 10:20 pm (GMT 5.5)

Quote:
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.
Remember, too, that there is an upper limit to the number of DD statements you are allowed in a single job. That limit can vary by site but is no higher than 3273. Depending upon the number of data sets you want to create, you may need multiple jobs to do this.
_________________
TANSTAAFL

The first rule of code reuse is that the code needs to be worth re-using.

"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." -- Donald Knuth


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

$
0
0
Author: Rohit Umarjikar
Posted: Tue Aug 29, 2017 10:30 pm (GMT 5.5)

I know its not a good practice but an option if it is just limits to 5.
Code:
//STEP1   EXEC PGM=SORT                                                 
//INA      DD *                                                         
AAA 123                                                                 
BBB 345                                                                 
CCC 4579                                                               
DDD 4578                                                               
//INB      DD *                                                         
AAA 123                                                                 
BBB 345                                                                 
CCC 4579                                                               
DDD 4578                                                               
//SORTOUT  DD SYSOUT=*                                                 
//SYSOUT  DD SYSOUT=*                                                   
//SYSIN DD *                                                           
   OPTION COPY                                                         
   JOINKEYS F1=INA,FIELDS=(1,3,A),SORTED,NOSEQCK                       
   JOINKEYS F2=INB,FIELDS=(1,3,A),SORTED,NOSEQCK                       
   REFORMAT FIELDS=(F1:1,8,F1:4,1,F1:1,4,F1:1,4,F1:1,4,F1:1,4,F1:1,4)   

Output:
Code:
********************************* TOP OF DATA **********************************
AAA 123  AAA AAA AAA AAA AAA                                                   
BBB 345  BBB BBB BBB BBB BBB                                                   
CCC 4579 CCC CCC CCC CCC CCC                                                   
DDD 4578 DDD DDD DDD DDD DDD                                                   
******************************** BOTTOM OF DATA ********************************

_________________
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

JCL & VSAM :: RE: Mainframe dataset split

$
0
0
Author: sergeyken
Subject: Re: Reply to: Mainframe dataset split
Posted: Tue Aug 29, 2017 10:31 pm (GMT 5.5)

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.
_________________
Tyrannosaurus-REXX

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

$
0
0
Author: sergeyken
Subject: Re: SORT Trailer Count - LRECL Output controlled by Input (?)
Posted: Tue Aug 29, 2017 10:39 pm (GMT 5.5)

amorante wrote:
All I need Is to count the number of record in sortin…. Output format as shown, question is can I do it in the same step or do I have to add another step and then I could alter the input using INREC to go up to 80 and then use trailer1 for sortof3, (this changes sortof2 and sortout to be 80 which is no good, that is why I would have to add another step, seriously ?)

What prevents you from doing this in one step??
I do not see any reason for that yet.

Did you get any error, or what?
_________________
Tyrannosaurus-REXX

TSO/ISPF :: RE: How to change a string containing the command delimiter

$
0
0
Author: sergeyken
Posted: Tue Aug 29, 2017 10:44 pm (GMT 5.5)

chong.zhou wrote:
Thank you sergeyken. Your 1st idea can't be better. Great!!

Whenever I was in need of making changes for a very sophisticated combinations of characters, first I used some combination of EXCLUDE/FIND commands - to display only those lines I was interested in, and then used "CHANGE NX ALL ..." command, for not to affect unexpected lines of code.
_________________
Tyrannosaurus-REXX

JCL & VSAM :: RE: Mainframe dataset split

$
0
0
Author: daveporcelan
Posted: Tue Aug 29, 2017 11:08 pm (GMT 5.5)

I don't know how to do it using 'JCL', but the solution is simple using REXX.

I have done something similar this way.

Just an option, that is all.

Viewing all 8500 articles
Browse latest View live