Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How can I generate a serie of numbers automatically

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Sat Jan 23, 2010 6:16 pm    Post subject: How can I generate a serie of numbers automatically
Reply with quote

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
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Jan 23, 2010 8:39 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Sun Jan 24, 2010 1:26 am    Post subject:
Reply with quote

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Sun Jan 24, 2010 2:13 am    Post subject:
Reply with quote

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 icon_smile.gif and does'nt work
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Jan 24, 2010 3:22 am    Post subject:
Reply with quote

Hello,

Quote:
i not tried this, pls tel me that this is a joke
Why not? Why might you believe this is a joke icon_confused.gif

Suggest you run this on your system and reply back here with the outcome. . .
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Sun Jan 24, 2010 11:13 am    Post subject:
Reply with quote

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
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Sun Jan 24, 2010 11:14 am    Post subject:
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sun Jan 24, 2010 2:06 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Sun Jan 24, 2010 2:30 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sun Jan 24, 2010 3:33 pm    Post subject:
Reply with quote

>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
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Sun Jan 24, 2010 4:11 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Sun Jan 24, 2010 5:08 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sun Jan 24, 2010 5:39 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Jan 25, 2010 11:19 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Tue Jan 26, 2010 9:42 am    Post subject:
Reply with quote

Thank you , frank. The code runs smoothly.
Every time I need help, you are always ready. Thank you sincerely.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Row-Numbers of distinct rows? Auryn DB2 1 Thu Oct 20, 2016 4:38 pm
No new posts Generate Cohort report using SORT Indrajit_57 SYNCSORT 6 Wed Jun 01, 2016 9:41 am
No new posts comparing comp-3 and unpacked numbers juares castro COBOL Programming 3 Mon May 30, 2016 6:46 pm
No new posts How to map virtual printer in JCL, to... user_22 JCL & VSAM 6 Fri Apr 15, 2016 10:04 pm
No new posts Sort Trick for numbers pshongal DFSORT/ICETOOL 4 Tue Mar 22, 2016 1:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us