View previous topic :: View next topic
|
Author |
Message |
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
hello, experts,
I'm going to make a D/S which containing number from 93000A to 93999A. (1000 records in all)
That is, the result dataset should be like this:
Code: |
93000A
93001A
93002A
93003A
...
93999A
|
In the above result, record is from 93000 to 93999 with increment 1 when a new record added.
Can you provide me a relatively simple way to realize this?
Thank you very much! |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
edit a member/ds with 80 columns.
command line:
x all
delete all x
add one line
line comand:
R999
command line:
num on
renum
num off
bnds 1 6
x all
line command
>2
command line:
bnds 1 80
chg all 1 2 p'==' '93'
chg all 6 6 p'=' 'A'
reset
save <numset>
edit your target ds.
command line
num off
copy <numset>
save
have a good weekend. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Below SORT step will give you desired output...
Code: |
//STEP0010 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
DUMMY RECORD
//SORTOUT DD DSN=your.output.dsn
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REPEAT=1000,BUILD=(C'93',SEQNUM,3,ZD,START=0,C'A')
//*
|
|
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Quote: |
command line:
x all
delete all x
add one line
line comand:
R999
command line:
num on
renum
num off
bnds 1 6
x all
line command
>2
command line:
bnds 1 80
chg all 1 2 p'==' '93'
chg all 6 6 p'=' 'A'
reset
save <numset>
edit your target ds.
command line
num off
copy <numset> |
omg i not tried this, pls tel me that this is a joke and does'nt work |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
i not tried this, pls tel me that this is a joke |
Why not? Why might you believe this is a joke
Suggest you run this on your system and reply back here with the outcome. . . |
|
Back to top |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
dbzTHEdinosauer wrote: |
edit a member/ds with 80 columns.
command line:
x all
delete all x
add one line
line comand:
R999
command line:
num on
renum
num off
bnds 1 6
x all
line command
>2
command line:
bnds 1 80
chg all 1 2 p'==' '93'
chg all 6 6 p'=' 'A'
reset
save <numset>
edit your target ds.
command line
num off
copy <numset>
save
have a good weekend. |
hi, Thank you for your quick answer.
but when I tried with your command, I failed.
I found error when I issue the following two commands:
>2
save <numset>
Would you please tell me the usage of the above "save <numset>" command?
I referred the command reference, but there was no parameters following SAVE according the "SAVE" command grammar.
Appreciate it very much! |
|
Back to top |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
Sambhaji wrote: |
Below SORT step will give you desired output...
Code: |
//STEP0010 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
DUMMY RECORD
//SORTOUT DD DSN=your.output.dsn
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REPEAT=1000,BUILD=(C'93',SEQNUM,3,ZD,START=0,C'A')
//*
|
|
The step goes well, thank you very much! |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
dejunzhu,
you are correct,
the line command should have been >1 not >2
and the SAVE <numset> was incorrect
should have been SAVE
i apologize that the description was not clear. |
|
Back to top |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
dbzTHEdinosauer wrote: |
dejunzhu,
you are correct,
the line command should have been >1 not >2
and the SAVE <numset> was incorrect
should have been SAVE
i apologize that the description was not clear. |
Hello, Thank you for your reply!
But I still cannot get the desired result with your commands.
Can you please have a try?
I still got error when I issue the following command:
>1 |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
>1 is a line command.
I was only trying to make you aware of the 'power' of ISPF. When one's skill set includes the ISPF edit commands that are available and the rather rich set of string manipulation capabilities of REXX, one can accomplish a lot in foreground mode.
That can be important, if you wish to get things done now, when you are working on a small machine or one that has so many users (last place I worked at had 10,000 avg tso users per day, submitting jobs all day long.
A simple job - less than 20 sec wall clock - sometimes had to wait for several hours to run.
a sort job - which if not invoked via rexx in foreground mode, will involve a batch job - a job submitted that must wait for time to run.
I do apologize for wasting your time on something that you had to learn and could adapt for future tasks,
instead of something that just provided you with a solution to your current problem. |
|
Back to top |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
dbzTHEdinosauer wrote: |
>1 is a line command.
I was only trying to make you aware of the 'power' of ISPF. When one's skill set includes the ISPF edit commands that are available and the rather rich set of string manipulation capabilities of REXX, one can accomplish a lot in foreground mode.
That can be important, if you wish to get things done now, when you are working on a small machine or one that has so many users (last place I worked at had 10,000 avg tso users per day, submitting jobs all day long.
A simple job - less than 20 sec wall clock - sometimes had to wait for several hours to run.
a sort job - which if not invoked via rexx in foreground mode, will involve a batch job - a job submitted that must wait for time to run.
I do apologize for wasting your time on something that you had to learn and could adapt for future tasks,
instead of something that just provided you with a solution to your current problem. |
I got it. Indeed I issued >1 as a line command. But not only >1 command did not work, I found ">" command did not take effect until I issue ")" command first.
I do not quite understand why this phenomenon appears, even though I investigated them from ISPF EDIT Command reference. |
|
Back to top |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
Finally, I have found the solution to it.
Please allow me to amend your command in the following section:
num on ==>num on std cobol
>1 ==>)1
after the above modification, the desired dataset can be generated.
Thank you ,dick! |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
djunzhu,
you never have to ask my permission to modify code.
your modifying shows that you are learning - my intent.
thx, a very successful Sunday for me.
ps: you may have to insure that 73 - 80 are blanks - and not populated with sequence numbers. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
FWIW, here's another way to do it with DFSORT:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
DUMMY RECORD
//SORTOUT DD DSN=... output file
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REPEAT=1000,BUILD=(SEQNUM,5,ZD,START=93000,C'A')
//*
|
|
|
Back to top |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
Thank you , frank. The code runs smoothly.
Every time I need help, you are always ready. Thank you sincerely. |
|
Back to top |
|
|
|