Hi,
I want to download a table with some fields like this PIC S9(14)V9(4) USAGE COMP-3.
With my normal procedure I'll get (1.....ïÊÀ-ýT....&)
Is it possible to do something special in my JCL, so that these fields will come our readable ?
Thanks
Michael
Download table with comp-3 fields
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: Download table with comp-3 fields
1. You probably need not to “download” your table, but instead to “unload” it, correct?
2. JCL has absolutely nothing to do with either of the processes: unload, or download.
3. To unload any table from DB2 one of available DB2-related utilities should be used. Most of those utilities do have their own options, to define what is the required fields format after unloading.
Hope this helps to start with.
2. JCL has absolutely nothing to do with either of the processes: unload, or download.
3. To unload any table from DB2 one of available DB2-related utilities should be used. Most of those utilities do have their own options, to define what is the required fields format after unloading.
Hope this helps to start with.
Javas and Pythons come and go, but JCL and SORT stay forever.
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: Download table with comp-3 fields
Since there is no reaction to the given primary recommendations, here is the next clue.
Please, present at this forum any information on:
1) which particular utility you are using to unload your table?
2) what code is used to call this utility? It may be either JCL, or many other options are available. Please, provide the code used to invoke that utility, and do not forget to use code tags in your examples.
3) please, investigate, and present here the utility options used in your examples.
After all, or part of such information becomes available, there is a chance that some experts would give you a useful advise on your issue.
Please, present at this forum any information on:
1) which particular utility you are using to unload your table?
2) what code is used to call this utility? It may be either JCL, or many other options are available. Please, provide the code used to invoke that utility, and do not forget to use code tags in your examples.
3) please, investigate, and present here the utility options used in your examples.
After all, or part of such information becomes available, there is a chance that some experts would give you a useful advise on your issue.
Javas and Pythons come and go, but JCL and SORT stay forever.
-
- Posts: 6
- Joined: Thu Jun 18, 2020 3:54 pm
- Skillset: Cobol, DB2, JCL
- Referer: Internetsearch
- Location: Switzerland
Re: Download table with comp-3 fields
Hi,
you're right - it^s more an unload than a download...
I do it this way
//STEP0010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (TMAK.SYSREC.T0050TEP.NRTBE) NVSAM
DELETE (TMAK.SYSPUN.T0050TEP) NVSAM
IF MAXCC=8 THEN SET MAXCC=0
/*
//STEP0020 EXEC DSNUPROC,SYS='D2BB'
//*
//SYSREC DD DSN=TMAK.SYSREC.T0050TEP.NRTBE,
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(200,100),RLSE),AVGREC=U
//*
//SYSPUNCH DD DSN=TMAK.SYSPUN.T0050TEP,
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(200,100),RLSE),AVGREC=U
//*
//SYSIN DD *
UNLOAD DATA FROM TABLE ANJA1E.T0050TEP;
WHEN (STICHTAG = '2021-02-23')
/*
With that procedure I have my data in TMAK.SYSREC.T0050TEP.NRTBE - with the problem, that I can't read the comp-3 fields.
you're right - it^s more an unload than a download...
I do it this way
//STEP0010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (TMAK.SYSREC.T0050TEP.NRTBE) NVSAM
DELETE (TMAK.SYSPUN.T0050TEP) NVSAM
IF MAXCC=8 THEN SET MAXCC=0
/*
//STEP0020 EXEC DSNUPROC,SYS='D2BB'
//*
//SYSREC DD DSN=TMAK.SYSREC.T0050TEP.NRTBE,
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(200,100),RLSE),AVGREC=U
//*
//SYSPUNCH DD DSN=TMAK.SYSPUN.T0050TEP,
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(200,100),RLSE),AVGREC=U
//*
//SYSIN DD *
UNLOAD DATA FROM TABLE ANJA1E.T0050TEP;
WHEN (STICHTAG = '2021-02-23')
/*
With that procedure I have my data in TMAK.SYSREC.T0050TEP.NRTBE - with the problem, that I can't read the comp-3 fields.
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: Download table with comp-3 fields
First of all, you ignore recommendations to use code tags to post your code examples.
Did you try to do some search, either in this forum, or in Google? There are tons of examples, guides, and explanations of exactly the same, and similar issues.
For instance, My requirement to unload a table data in readable format, and thousands of other examples.
Did you try to do some search, either in this forum, or in Google? There are tons of examples, guides, and explanations of exactly the same, and similar issues.
For instance, My requirement to unload a table data in readable format, and thousands of other examples.
Javas and Pythons come and go, but JCL and SORT stay forever.
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: Download table with comp-3 fields
Your presentation must look in this way:
I demonstrates, that you have not a minor idea how things work.
1) The step with IDCAMS has no direct relation to the unload operation itself; it cannot affect the way to resolve your issue.
2) The UNLOAD operation provided by DSNUPROC procedure is extremely limited in available options to control the output dataset format.
3) The semicolon at the end of the first UNLOAD statement line seems to be either syntax error, or misleading.
4) When using DSNUPROC/UNLOAD you may need one extra step (of SORT utility, or FILEAID, or whatever else), - to convert output data format(s) to what you really need.
5) The //SYSPUNCH DD defines the dataset to save an optional LOAD statement, for future reload of unloaded data back to DB2 tables. It needs to be RECFM=FB,LRECL=80, and its maximum possible SPACE=(TRK,(1,1)), but not SPACE=(CYL,(100,200))
6) Since you are not going to re-load the data back to DB2, but instead planning to convert data format(s), the //SYSPUNCH DD dataset is not required at all.
7) More convenient way to unload data in printable format would be using other utilities, like DSNTIAUL, or HPU (PGM=INZUTILB, High Performance Utility), or FileAid/DB2, or others, which do have their own options to specify the unloaded fields formats.
8) None of JCL options can affect the way how DB2 table is unloaded; this is 100% internal issue of the utility used to unload data.
Unfortunately, from the first sight it's getting clear that the presented example of JCL code has been copied-and-pasted from unknown source, without a minor attempt to understand it...
Code: Select all
//STEP0010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (TMAK.SYSREC.T0050TEP.NRTBE) NVSAM
DELETE (TMAK.SYSPUN.T0050TEP) NVSAM
IF MAXCC=8 THEN SET MAXCC=0
/*
//STEP0020 EXEC DSNUPROC,SYS='D2BB'
//*
//SYSREC DD DSN=TMAK.SYSREC.T0050TEP.NRTBE,
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(200,100),RLSE),AVGREC=U
//*
//SYSPUNCH DD DSN=TMAK.SYSPUN.T0050TEP,
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(200,100),RLSE),AVGREC=U
//*
//SYSIN DD *
UNLOAD DATA FROM TABLE ANJA1E.T0050TEP;
WHEN (STICHTAG = '2021-02-23')
/*
I demonstrates, that you have not a minor idea how things work.
1) The step with IDCAMS has no direct relation to the unload operation itself; it cannot affect the way to resolve your issue.
2) The UNLOAD operation provided by DSNUPROC procedure is extremely limited in available options to control the output dataset format.
3) The semicolon at the end of the first UNLOAD statement line seems to be either syntax error, or misleading.
4) When using DSNUPROC/UNLOAD you may need one extra step (of SORT utility, or FILEAID, or whatever else), - to convert output data format(s) to what you really need.
5) The //SYSPUNCH DD defines the dataset to save an optional LOAD statement, for future reload of unloaded data back to DB2 tables. It needs to be RECFM=FB,LRECL=80, and its maximum possible SPACE=(TRK,(1,1)), but not SPACE=(CYL,(100,200))
6) Since you are not going to re-load the data back to DB2, but instead planning to convert data format(s), the //SYSPUNCH DD dataset is not required at all.
7) More convenient way to unload data in printable format would be using other utilities, like DSNTIAUL, or HPU (PGM=INZUTILB, High Performance Utility), or FileAid/DB2, or others, which do have their own options to specify the unloaded fields formats.
8) None of JCL options can affect the way how DB2 table is unloaded; this is 100% internal issue of the utility used to unload data.
Unfortunately, from the first sight it's getting clear that the presented example of JCL code has been copied-and-pasted from unknown source, without a minor attempt to understand it...
Javas and Pythons come and go, but JCL and SORT stay forever.
-
- Similar Topics
- Replies
- Views
- Last post
-
- 3
- 5863
-
by sergeyken
View the latest post
Sat Dec 10, 2022 2:30 am
-
-
How to download the source code of a Endevor processor?
by hujirong » Wed Nov 02, 2022 12:26 am » in All Other Tools - 0
- 3031
-
by hujirong
View the latest post
Wed Nov 02, 2022 12:26 am
-
-
-
Moving High-Values from Comp-3 - COBOL Ver 6.4
by girik1001 » Thu Jul 20, 2023 12:08 pm » in IBM Cobol - 1
- 3888
-
by sergeyken
View the latest post
Thu Jul 20, 2023 6:38 pm
-
-
-
how to extract a portion (e.g. fields 10 - 20) of a record
by ISPFTSOJCL » Fri Feb 26, 2021 5:33 am » in JCL - 2
- 1678
-
by enrico-sorichetti
View the latest post
Fri Feb 26, 2021 2:37 pm
-
-
- 1
- 1752
-
by sergeyken
View the latest post
Fri Mar 26, 2021 11:59 pm