Welcome to CompShack!
CompShack is a user driven Dev2Dev IT community. Developers can ask questions, help answer questions, or just browse code and articles contributed by users. No registration required.
You can register if you want to contribute code samples, share your knowledge at your own blog, and become adored in the community!

Contribute!

Contribute!Do you find yourself with few minutes to spare, and a desire to help other CompShackers?

Submit a tip, code or an SQL snippet. Start an article about topics you are familier with, or edit a Wiki page. Help the community grow larger by sharing a little bit of what you know!

Reasons why this is great:

  • You help your fellow CompShackers
  • Give back to the community and help it grow
  • Easy access to your code any time you need it
  • Become known and adored in the community!

Note: Registration required. Guests can edit Wiki pages.

Please try to help out with unanswered topics on the forum. Chances are you have had the same issue/question some time in your IT career!

Code to get the record and count from the data base

Step:1 PeopleCode:
Local File &MYFILE;
Local string &str_cnt;
Local string &FPath;

&str_cnt = "Record Name" | Char(9) | "Count";
&FPath = "\\psapsftt\TTEF\OneSource\PC-Inbound\Record.xls";
&MYFILE = GetFile(&FPath, "W", %FilePath_Absolute);
&MYFILE.WriteLine(&str_cnt);

Step2:Doselect

%SelectInit(RECNAME)
SELECT RECNAME
FROM %Table(PSRECDEFN)
WHERE RECNAME NOT IN (Record Names)
AND RECTYPE NOT IN (2,3,5) /*2 - Derived/Work 3- Sub-Record 5- Dynamic View */

Step:3:SQl
%SelectInit(COUNTER1)
SELECT COUNT(*)
FROM %Table(%bind(RECNAME))

Step:4:PeopleCode:

Code would useful to create a .txt file thru App Engine

Write the code in PeopleCode Action:
Local File &MYFILE;
&PS_SERVDIR = (GetEnv("PS_SERVDIR")) | "/";
&FPath = &PS_SERVDIR | "file.txt";
&MYFILE = GetFile(&FPath, "W", %FilePath_Absolute);
&MYFILE.WriteLine(&Input);

&MYFILE.Close();

Code useful to view a file

SQLExec(SQL.CSGC_DB_NAME, &NAME);
SQLExec("SELECT URL FROM %Table(:2) WHERE DISTNODENAME=:1", &NAME, Record.CDM_DIST_NODE, &URL);
&PRCSOUTPUTDIR = &URL | "/CSGC_CSHEET1.pdf";
ViewContentURL(&PRCSOUTPUTDIR);
ViewContentURL(“www.gmail.com”);