IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

question on Outrec and sort #Digvijay


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 148
Location: India

PostPosted: Fri Jun 10, 2022 3:49 pm
Reply with quote

Hi All,

i have one file my file has 3 rows please see below.



Code:
 ssssssssssssssssssssssssssssssssssssssssssssssssss
 VIEW       ALT0.Q.NDVR.INTERNAL.ETT2             
 Command ===>                                     
 ****** ***************************** Top of Data *
 000100 P125029      ----represend job nanem                             
 000200 QSYS          ----represent environment                             
 000300 0202248      ------RITM nbr                             
 ****** **************************** Bottom of Data



using this file want to create a file wihc name should look like below

ALT0.Q.NDVR.INTERNAL.ETT2.RITM

if above is the input file my output file would look like below
ALT0.Q.NDVR.INTERNAL.ETT2.0202248

IF you notice in my output file RITM nbr should append at the end of my out put file which i have in my input file RITM nbr 3rd row.

Is this possible this is my first requirment is there any way i can create my output file like this having RITM nbr at the end appended...? Please help me.
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 148
Location: India

PostPosted: Fri Jun 10, 2022 6:03 pm
Reply with quote

can anyone give any suggestion here please, would be great help .

Thanks
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2127
Location: USA

PostPosted: Fri Jun 10, 2022 6:12 pm
Reply with quote

Using any SORT-like product for this task is possible, but would look as a kink. Anyway, it can be done by any IT student who has passed 1-2 years in a college, otherwise he might be expelled.

My grandkid is 18 years old - he can easily do this task.

The best solution (in mainframe environment) would be REXX, I guess.
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Fri Jun 10, 2022 6:19 pm
Reply with quote

First of all in a Data set name, each qualifier must begin with an alphabetic character (A to Z) or the special character @, #, or $.

Quote:
Data set naming rules

A data set name consists of one or more parts connected by periods. Each part is called a qualifier.
Each qualifier must begin with an alphabetic character (A to Z) or the special character @, #, or $.
The remaining characters in each qualifier can be alphabetic, special, or numeric (0 to 9) characters.
Each qualifier must be 1 to 8 characters in length.
The maximum length of a complete data set name before specifying a member name is 44 characters, including the periods.


Next you need to find a pattern to identify RITM numbers. Will you always have the RITM numbers in the 3rd record, starting from col 1, always of 7 digits etc.

Then you can build a solution using SORT, REXX or a combination of both.
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 148
Location: India

PostPosted: Fri Jun 10, 2022 7:15 pm
Reply with quote

Answer is:

Yes RITM numbers will alwasy be in 3rd record starting from col1 to 7.


i would like my file name should look like

ALT0.Q.NDVR.INTERNAL.ETT2.R0202248
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 148
Location: India

PostPosted: Fri Jun 10, 2022 8:51 pm
Reply with quote

I do not have any experience in rexx and i am trying to find out solution through sort.



Thanks
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Fri Jun 10, 2022 8:56 pm
Reply with quote

You can either write a two step JCL: Step 1 - Using DFSORT to generates a job (SORTOUT) that allocates the data set names you want using IEFBR14 and Step 2 - use IEBGENER to submit the job created in Step1(SORTOUT) via the Internal Reader (INTRDR) or you can write a REXX program.
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Fri Jun 10, 2022 9:20 pm
Reply with quote

Another method is: you can use SORT to generate an IDCAMS ALLOCATE SYSIN card (Sample Card):
Code:
  ALLOC FI(OUT) DA('ALT0.Q.NDVR.INTERNAL.ETT2.R0000001') -
        DSORG(PS) RECFM(F B) LRECL(80) -
        SPACE(1 1) TRACKS NEW CATALOG REUSE
  ALLOC FI(OUT) DA('ALT0.Q.NDVR.INTERNAL.ETT2.R0000002') -
        DSORG(PS) RECFM(F B) LRECL(80) -
        SPACE(1 1) TRACKS NEW CATALOG REUSE
......
......
......
  ALLOC FI(OUT) DA('ALT0.Q.NDVR.INTERNAL.ETT2.R000000n') -
        DSORG(PS) RECFM(F B) LRECL(80) -
        SPACE(1 1) TRACKS NEW CATALOG REUSE

And then run IDCAMS using the above SYSIN Card.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1329
Location: Bamberg, Germany

PostPosted: Fri Jun 10, 2022 11:05 pm
Reply with quote

I guess it has been explained a couple of times that, providing information from a dataset to allocate new datasets with the information from there is not the technique z/OS is famous for.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2127
Location: USA

PostPosted: Fri Jun 10, 2022 11:09 pm
Reply with quote

Digvijay Singh wrote:
Is this possible this is my first requirment is there any way i can create my output file like this having RITM nbr at the end appended...? Please help me.

Did you know that none version of SORT would be able to create a dataset (since files do not exist at all in zOS/MVS)?

SORT might help you to create the DSNAME (dataset name) itself, as a text string data.

In zOS creation of any DATASET can be done only in those ways:
- using DISP=NEW parameter in DD statement of JCL,
- using control statements for IDCAMS system utility,
- using some dynamic allocation tools/functions, available in some programming languages, including REXX, COBOL, C/C++. Assembler, PL/I, others.

SORT cannot do this part of your job for you.
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 148
Location: India

PostPosted: Mon Jun 13, 2022 7:24 pm
Reply with quote

thanks all for your reply:

I also did my research and i did not find any way doing this through sort.


if you guys can hep me with these two questions:

1> logic if file exist it should delete that file and execute the step
2> i have two file

Code:
file 1>

 [code]sssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
 VIEW       QSYS.SORT.RC.FAIL.CODE1                         
 Command ===>                                               
 ****** ***************************** Top of Data [/code]**********
 000001 &ENV RITM&TIRID  MESSAGE: P761993  J0013408 RC=0012

File 2>

 s[code]sssssssssssssssssssssssssssssssssssssssssssssssss
 VIEW       ALT0.Q.NDVR.INTERNAL.ETT3             
 Command ===>                                     
 ****** ***************************** Top of Data *
 000100 P761993                                   
 000200 QSYS                                       
 000300 0202251                                   
 ****** **************************** Bottom of Data[/code]



my out put file should look like below :

   File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test
 ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
 VIEW       QSYS.SORT.RC.FAIL.CODE1                         Col
 Command ===>                                                 
 =COLS> ----+----1----+----2----+----3----+----4----+----5----+
 ****** ***************************** Top of Data *************
 000001 &ENV RITM&TIRID  MESSAGE: P761993  J0013408 RC=0012   
 000002 JOBNAME : P761993                                     
 000003 ENV:QSYS                                               
 000004 RITM:0202251                                           
 ****** **************************** Bottom of Data
***********


I NEED SORT CARD TO PREPARE THE FILE LIKE THIS
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 148
Location: India

PostPosted: Mon Jun 13, 2022 8:14 pm
Reply with quote

Hi All i have got my 1st question answer only looking for 2nd one if anyone can give any hint, i sorry for being too demanding in my previous post.

I am looking for that outrec sort card now, please help me
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 148
Location: India

PostPosted: Mon Jun 13, 2022 8:19 pm
Reply with quote

mistah kurtz wrote:
You can either write a two step JCL: Step 1 - Using DFSORT to generates a job (SORTOUT) that allocates the data set names you want using IEFBR14 and Step 2 - use IEBGENER to submit the job created in Step1(SORTOUT) via the Internal Reader (INTRDR) or you can write a REXX program.




Could you please give sort card to generate the dsn name atleast having ritm nbr appended at the end...?

would be much helpful.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2127
Location: USA

PostPosted: Mon Jun 13, 2022 8:43 pm
Reply with quote

Digvijay Singh wrote:
Could you please give sort card to generate the dsn name atleast having ritm nbr appended at the end...?

would be much helpful.


You can find it here
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 148
Location: India

PostPosted: Mon Jun 13, 2022 9:40 pm
Reply with quote

Hi I am sorry i tried finding it out but there are many and half of the post are incomplete couldn't get the solution.

Do you have the exact link . i just need ti create the file name using datat in my sortin file.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2127
Location: USA

PostPosted: Mon Jun 13, 2022 9:49 pm
Reply with quote

Digvijay Singh wrote:
Hi I am sorry i tried finding it out but there are many and half of the post are incomplete couldn't get the solution.

Do you have the exact link . i just need ti create the file name using datat in my sortin file.


You can find many examples here

P.S. They are only examples. You cannot find a ready-to-use code suitable exactly for your own job.

Try to do at least something by yourself, before begging others.
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 148
Location: India

PostPosted: Mon Jun 13, 2022 10:18 pm
Reply with quote

above is same link , solutions are not clear.

Anyway will try more sergeyken .

Thanks for your response.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2127
Location: USA

PostPosted: Mon Jun 13, 2022 10:19 pm
Reply with quote

Digvijay Singh wrote:
above is same link , solutions are not clear.

Anyway will try more sergeyken .

Thanks for your response.


They are only examples. You cannot find a ready-to-use code suitable exactly for your own job.

Try to do at least something by yourself.

I tried the search in DFSORT forum by keyword BUILD.
This is the result:
Search found 415 matches: BUILD

I recommend you to look through those 415 topics, since you don't want to RTFM.
Edited bad language
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 148
Location: India

PostPosted: Mon Jun 13, 2022 10:33 pm
Reply with quote

Will do it , it just the post were incomplete.

Or i am not able to search it with right keywords. Will find it out thanks for your help.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2127
Location: USA

PostPosted: Tue Jun 14, 2022 1:18 am
Reply with quote

Digvijay Singh wrote:
Will do it , it just the post were incomplete.

Or i am not able to search it with right keywords. Will find it out thanks for your help.


Please, move this senseless discussion to the Beginners and Students Forum
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Tue Jun 14, 2022 3:53 am
Reply with quote

You can write a simplle COBOL program and prep the SDSORT Card with target DS name and submit another JCL using INTRDR,*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts OPC scheduling question IBM Tools 0
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts Is this possible via sort (in one pass)? SYNCSORT 4
No new posts GDG generation name to GDG Base name ... DFSORT/ICETOOL 3
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
Search our Forums:

Back to Top